我想打電話給使用WSE 3.0作爲客戶端的第三方Web服務在Visual Studio 2005「指定的類型無法識別」嘗試調用Web服務調用
呼叫工作正常,我當異常可以看到我得到了很好的響應(我啓用了跟蹤),但顯然xml解析器扼殺了它。我總是得到一個InvalidOperationException
:
XML文檔中有en錯誤。
與InnerException
:
指定的類型不能被識別:名稱= '地圖',命名空間= 'http://xml.apache.org/xml-soap',在< bevoegdheid的xmlns = '' >。
這是響應的相關部分:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="https://acceptatie.cartalk.nl/Soap/Apk" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<SOAP-ENV:opvragenKeurmeesterGegevensResponse>
<opvragenKeurmeesterGegevensReturn xsi:type="ns2:Backend_Apk_Result_OpvragenKeurmeesterGegevens">
<naam xsi:type="xsd:string">A name</naam>
...
<bevoegdheid SOAP-ENC:arrayType="ns1:Map[2]" xsi:type="SOAP-ENC:Array">
<item xsi:type="ns1:Map">
<item>
<key xsi:type="xsd:string">soortBevoegdheid</key>
<value xsi:type="xsd:string">AL</value>
</item>
...
</item>
<item>
...
</item>
</bevoegdheid>
<meldingSoort xsi:nil="true" />
<meldingNummer xsi:nil="true" />
<melding xsi:nil="true" />
</opvragenKeurmeesterGegevensReturn>
</SOAP-ENV:opvragenKeurmeesterGegevensResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
這是怎麼說, 「bevoegdheid」 在WSDL定義:
<xsd:element name="bevoegdheid" type="soap-enc:Array" />
有一個沒有提到「地圖「類型的任何地方在wsdl。
我一直在谷歌上搜索周圍這一點,但唯一的一種答案,我發現是沿
東西線服務使用RPC /編碼格式,它是很難獲得互操作性。如果您可以將服務器更改爲文檔/文字,則效果會更好。
但是,由於這是第三方服務(已被其他客戶使用),這對我們來說不是選擇。
其他建議?如何讓XML解析器識別「Map」類型?