2014-08-28 39 views
1

所以我的同事已經編寫了一個簡單的web服務progress4GL,期望從我作爲輸入參數 - >數據集並返回給我一個數據集。這裏是Web服務如何將進度4GL數據集輸出參數轉換爲.net類型時消耗進度4Gl網絡服務

Define TEMP-TABLE TTList NO-UNDO 
     FIELD CtrlName   AS CHAR 
     FIELD WrdNr    AS INT 
     FIELD Descr    AS CHAR 
     FIELD DescrShort  AS CHAR 
     FIELD DescrTooltip  AS CHAR 

     FIELD TRecid    AS INT 
     . 

DEFINE DATASET ds FOR TTList. 

DEFINE INPUT  PARAMETER pCoCd       AS CHARACTER NO-UNDO. 
DEFINE INPUT  PARAMETER pLanCd      AS CHARACTER NO-UNDO. 
DEFINE INPUT  PARAMETER pUsrCd      AS CHARACTER NO-UNDO. 
DEFINE INPUT  PARAMETER pFilter      AS CHARACTER NO-UNDO. 
DEFINE INPUT-OUTPUT PARAMETER DATASET      FOR ds. 
DEFINE  OUTPUT PARAMETER pErrorTxt      AS CHARACTER NO-UNDO. 

而在.NET中,當我使用的Web服務.NET期望通過XmlElement的類型爲progress4gl輸入 - 輸出數據集參數

XmlElement docresult = doc.DocumentElement; 
      beaHostDB.TranslateList(pCoCd, languageID, " ", " ", ref docresult, out pErrorTxt); 

但昨天,當我的同事上傳服務器上的Web服務時 - 當我對Web服務進行新的Web引用時 - 突然輸出這個輸出 - 輸入數據集參數.net表示它期望beaHost.ds11TTList d s11類型。 (這裏beaHost是對webService的引用的名稱)。

有人可以幫助我ehat可能是問題

!UPDATE

下面是從服務器的WSDL(我只提供了差異片段)

schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:BeaWeb:BeaWeb"> 
    <element name="ds"> 
    <complexType> 
    <sequence> 
    <element maxOccurs="unbounded" minOccurs="0" name="TTArticle"> 
    <complexType> 
    <sequence> 
    <element name="ArtCd" nillable="true" type="xsd:string"/> 
    <element name="Descr" nillable="true" type="xsd:string"/> 
    <element name="Photo" nillable="true" prodata:dataType="prodata:blob" type="xsd:base64Binary"/> 
    <element name="Price" nillable="true" type="xsd:decimal"/> 
    <element name="CurrCd" nillable="true" type="xsd:string"/> 
    <element name="AvStockQty" nillable="true" type="xsd:decimal"/> 
    <element name="TRecid" nillable="true" type="xsd:int"/> 
    </sequence> 
    </complexType> 
    </element> 
    </sequence> 
    </complexType> 
    </element> 
    <element name="ds2"> 
    <complexType> 
    <sequence> 
    <element maxOccurs="unbounded" minOccurs="0" name="TTArticleGroup"> 
    <complexType> 
    <sequence> 
    <element name="ArticleGroupLinkSeqNr" nillable="true" type="xsd:int"/> 
    <element name="ParentArticleGroupLinkSeqNr" nillable="true" type="xsd:int"/> 
    <element name="PreParentArticleGroupLinkSeqNr" nillable="true" type="xsd:int"/> 
    <element name="SeqNr" nillable="true" type="xsd:int"/> 
    <element name="ArtGroupCd" nillable="true" type="xsd:string"/> 
    <element name="Descr" nillable="true" type="xsd:string"/> 
    <element name="Photo" nillable="true" prodata:dataType="prodata:blob" type="xsd:base64Binary"/> 
    <element name="AltText" nillable="true" type="xsd:string"/> 
    <element name="PgName" nillable="true" type="xsd:string"/> 
    <element name="TRecid" nillable="true" type="xsd:int"/> 
    </sequence> 
    </complexType> 
    </element> 
    </sequence> 
    </complexType> 
    </element> 
--- 
<element name="GetArticle"> 
<complexType> 
<sequence> 
<element name="pCoCd" nillable="true" type="xsd:string"/> 
<element name="pLanCd" nillable="true" type="xsd:string"/> 
<element name="pUsrCd" nillable="true" type="xsd:string"/> 
<element name="pFilter" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
<element name="GetArticleResponse"> 
<complexType> 
<sequence> 
<element name="result" nillable="true" type="xsd:string"/> 
<element ref="S2:ds"/> 
<element name="pErrorTxt" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
<element name="GetArticleGroup"> 
<complexType> 
<sequence> 
<element name="pCoCd" nillable="true" type="xsd:string"/> 
<element name="pLanCd" nillable="true" type="xsd:string"/> 
<element name="pUsrCd" nillable="true" type="xsd:string"/> 
<element name="pFilter" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
<element name="GetArticleGroupResponse"> 
<complexType> 
<sequence> 
<element name="result" nillable="true" type="xsd:string"/> 
<element ref="S2:ds2"/> 
<element name="pErrorTxt" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 

這裏從本地的wsdl文件

complexType name="dsChanges" prodata:datasetName="ds" prodata:isDsChanges="true" prodata:namespace="urn:beawebprogress:BeaWebProgress"> 
<sequence> 
<any/> 
</sequence> 
</complexType> 
<element name="ds"> 
<complexType> 
<sequence> 
<element maxOccurs="unbounded" minOccurs="0" name="TTArticle"> 
<complexType> 
<sequence> 
<element name="ArtCd" nillable="true" type="xsd:string"/> 
<element name="Descr" nillable="true" type="xsd:string"/> 
<element name="Photo" nillable="true" prodata:dataType="prodata:blob" type="xsd:base64Binary"/> 
<element name="Price" nillable="true" type="xsd:decimal"/> 
<element name="CurrCd" nillable="true" type="xsd:string"/> 
<element name="AvStockQty" nillable="true" type="xsd:decimal"/> 
<element name="TRecid" nillable="true" type="xsd:int"/> 
</sequence> 
</complexType> 
</element> 
</sequence> 
</complexType> 
</element> 
<complexType name="ds2Changes" prodata:datasetName="ds2" prodata:isDsChanges="true" prodata:namespace="urn:beawebprogress:BeaWebProgress"> 
<sequence> 
<any/> 
</sequence> 
</complexType> 
<element name="ds2"> 
<complexType> 
<sequence> 
<element maxOccurs="unbounded" minOccurs="0" name="TTArticleGroup"> 
<complexType> 
<sequence> 
<element name="ArticleGroupLinkSeqNr" nillable="true" type="xsd:int"/> 
<element name="ParentArticleGroupLinkSeqNr" nillable="true" type="xsd:int"/> 
<element name="PreParentArticleGroupLinkSeqNr" nillable="true" type="xsd:int"/> 
<element name="SeqNr" nillable="true" type="xsd:int"/> 
<element name="ArtGroupCd" nillable="true" type="xsd:string"/> 
<element name="Descr" nillable="true" type="xsd:string"/> 
<element name="Photo" nillable="true" prodata:dataType="prodata:blob" type="xsd:base64Binary"/> 
<element name="AltText" nillable="true" type="xsd:string"/> 
<element name="PgName" nillable="true" type="xsd:string"/> 
<element name="TRecid" nillable="true" type="xsd:int"/> 
</sequence> 
</complexType> 
</element> 
</sequence> 
</complexType> 
</element> 
------------------- 
<element name="GetArticle"> 
<complexType> 
<sequence> 
<element name="pCoCd" nillable="true" type="xsd:string"/> 
<element name="pLanCd" nillable="true" type="xsd:string"/> 
<element name="pUsrCd" nillable="true" type="xsd:string"/> 
<element name="pFilter" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
<element name="GetArticleResponse"> 
<complexType> 
<sequence> 
<element name="result" nillable="true" type="xsd:string"/> 
<element name="ds" type="S2:dsChanges"/> 
<element name="pErrorTxt" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
<element name="GetArticleGroup"> 
<complexType> 
<sequence> 
<element name="pCoCd" nillable="true" type="xsd:string"/> 
<element name="pLanCd" nillable="true" type="xsd:string"/> 
<element name="pUsrCd" nillable="true" type="xsd:string"/> 
<element name="pFilter" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
<element name="GetArticleGroupResponse"> 
<complexType> 
<sequence> 
<element name="result" nillable="true" type="xsd:string"/> 
<element name="ds2" type="S2:ds2Changes"/> 
<element name="pErrorTxt" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
+0

有一個WSDL對於Web服務,我們可以看到它嗎? – 2014-08-28 14:08:32

+0

嗨我已經從wsdl公佈了一個片段與差異 – 2014-08-29 06:59:19

回答

0

如果你沒有它,請下載Soa pUI從這裏:http://sourceforge.net/projects/soapui/files/

在SoapUI中,設置一個項目來調用你的web服務,看看它返回什麼 - 我的猜測是給予prodataset和/或發送到客戶端的臨時表的名稱doesn不符合你的.Net客戶端所期待的,這就是錯誤的來源。

如果是這種情況,請使用SERIALIZE-NAME屬性來獲取要在webservice和客戶端之間對齊的名稱。

我的猜測是,它是不符合TT的名字,所以你可以這樣做:

TEMP-TABLE ttlist:SERIALIZE-NAME = "ds11TTList". 

如果它的數據集,那麼這樣做:

DATASET ds:SERIALIZE-NAME = "CorrectDsName". 
+0

嗨,謝謝你 - 你可以從wsdl快速查看它返回服務器和本地主機 – 2014-08-29 07:00:01

+0

我沒有看到任何引用beaHost.ds11TTList ds11在這些WSDL的,所以我不能在這裏幫忙。您需要先找出代碼中的名稱,然後才能找出Web服務與.Net客戶之間存在不匹配的原因。 – 2014-08-29 14:38:34