Error deserializing response message body to work

I am having a problem communicating with a SOAP Axis web service using the Service Reference method with dotNet.

It seems that when the dotNet client deserializes the incoming xml stream, it expects an array, but it actually receives a single object. I thought there might be a problem with the xml message sent from the web service, but it looks ok.

Error message:

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'.

      

XML SOAP message:

<?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>

      

+3


source to share





All Articles