1
我从服务SOAP响应:反序列化SOAP响应C#
<SOAP-ENV:Body>
<ns1:getCurrencyListResponse>
<getCurrencyListReturn SOAP-ENC:arrayType="ns2:Map[2]" xsi:type="SOAP-ENC:Array">
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">id</key>
<value xsi:type="xsd:string">18</value>
</item>
<item>
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">USD</value>
</item>
</item>
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">id</key>
<value xsi:type="xsd:string">19</value>
</item>
<item>
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">EUR</value>
</item>
</item>
</getCurrencyListReturn>
</ns1:getCurrencyListResponse>
</SOAP-ENV:Body>
文件WSDL没有指定返回类型。我如何在C#中反序列化这些消息? “项目”和“地图”的数量不知道。应该类似于这个例子:
[SoapType(Namespace = "http://xml.apache.org/xml-soap", TypeName = "Map")]
public class Map
{
public item[] item;
}
public class item
{
[SoapElement]
public string key;
[SoapElement]
public string value;
}
这是一个分支。文件wsdl不指定返回类型。我想自己描述一下。 – Aleksey 2012-04-11 13:02:48