3

我在使用带有 dotNet 的服务引用方法与 SOAP Axis Web 服务进行通信时遇到了问题。

似乎当 dotNet 客户端反序列化传入的 xml 流时,它需要一个数组,但它实际上得到了一个对象。我认为从 Web 服务发送的 xml 消息可能存在问题,但看起来很正常。

错误信息:

Cannot assign object of type WebService.MessagingServices_SendMultiSMS_SendSuccess to an object of type WebService.MessagingServices_SendMultiSMS_SendSuccess[]. The error occurred while reading node with id='id1'.

SOAP XML 消息:

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMultiSMSResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://DefaultNamespace"><sendMultiSMSReturn href="#id0"/></ns1:sendMultiSMSResponse><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:MessagingServices_SendMultiSMSResult" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn"><CallSuccess xsi:type="xsd:boolean">true</CallSuccess><CallErrorMessage xsi:type="xsd:string">Success</CallErrorMessage><SMSCount xsi:type="xsd:int">2</SMSCount><MultiSMSPostedList href="#id1"/><MultiSMSPostedList href="#id2"/></multiRef><multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:MessagingServices_SendMultiSMS_SendSuccess" xmlns:ns3="urn" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><gRecipientName xsi:type="xsd:string">Me</gRecipientName><gRecipientMSISDNwithCC xsi:type="xsd:string">xxxxxx1</gRecipientMSISDNwithCC><gOutMsgID xsi:type="xsd:int">314437688</gOutMsgID></multiRef><multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:MessagingServices_SendMultiSMS_SendSuccess" xmlns:ns4="urn" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><gRecipientName xsi:type="xsd:string">Me</gRecipientName><gRecipientMSISDNwithCC xsi:type="xsd:string">xxxxxx2</gRecipientMSISDNwithCC><gOutMsgID xsi:type="xsd:int">314437687</gOutMsgID></multiRef></soapenv:Body></soapenv:Envelope>
4

0 回答 0