apacay
apacay

Reputation: 1712

SAP Webservice Client - Deserialization failed

I've created a simple Net WebSvc Client which receives an up to date reference of a SAP WebSvc. It expects a String, and four elements sent by reference: three arrays of custom objects and another custom object outside any collection structure (which I have their format in the reference page)

When the request to perform the operation is called, I get this exception on the call row. (At the bottom I write: An extract of my code, the Reference.cs method I call, and the error, as complete as I can.)

SoapException "Deserialization failed"

Investigating through the net, I've found this Thread of a SAP forum where someone answers that the common problems that show this error are, unupdated wsdl and underscore in the member variable names but neither of them are my case. In fact the thread continued but without any response to the guy with the same issue as me.

Anyways, I guess Stack Overflow guys are more active than that ;-)

Thanks in advance people!


Extract of my code:

 string destiny = "myDest";
 ZICQService ZICQ = new ZICQService();
 ZtyEE070[] innerHeadList = HeadLst.ToArray();
 ZtyEE071[] innerObjList = ObjLst.ToArray();
 Zrequest[] innerTRequest = TRequest.ToArray();
 //This is the row of the Deserialization failed
 Bapiret2 respnse = svc.ZbcInsertRequest(destiny, ref innerHeadList, ref innerObjList, IClrQst, ref innerTRequest); 

And this is my web service Reference.cs attached method:

    [System.Web.Services.Protocols.SoapDocumentMethodAttribute
    ("", RequestNamespace="urn:sap-com:document:sap:soap:functions:mc-style", 
    ResponseNamespace="urn:sap-com:document:sap:soap:functions:mc-style", 
    Use=System.Web.Services.Description.SoapBindingUse.Literal, 
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("Return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public Bapiret2 ZbcInsertRequest(
    [System.Xml.Serialization.XmlElementAttribute
        (Form=XmlSchemaForm.Unqualified)] 
    string Destino, 
    [System.Xml.Serialization.XmlArrayAttribute
        (Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] 
    [System.Xml.Serialization.XmlArrayItemAttribute
        ("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] 
    ref ZtyEE070[] EtRequestHeader, 
    [System.Xml.Serialization.XmlArrayAttribute
        (Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] 
    [System.Xml.Serialization.XmlArrayItemAttribute
        ("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] 
    ref ZtyEE071[] EtRequestObj, 
    [System.Xml.Serialization.XmlElementAttribute
        (Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] 
    Zclrqstdat IClrqst, 
    [System.Xml.Serialization.XmlArrayAttribute
        (Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] 
    [System.Xml.Serialization.XmlArrayItemAttribute
        ("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] 
    ref Zrequest[] TRequest) 
{
    object[] results = this.Invoke("ZbcInsertRequest", new object[] {
                Destino,
                EtRequestHeader,
                EtRequestObj,
                IClrqst,
                TRequest});
    EtRequestHeader = ((ZtyEE070[])(results[1]));
    EtRequestObj = ((ZtyEE071[])(results[2]));
    TRequest = ((Zrequest[])(results[3]));
    return ((Bapiret2)(results[0]));
}

The error:

System.Web.Services.Protocols.SoapException was unhandled  
Message="Deserialisation failed"  
Source="System.Web.Services"  
Actor=""   Lang="en"   Node=""  
Role=""   StackTrace:
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at SCM.Manager.mx.com.hylsamex.hmxwasd1.ZICQService.ZbcInsertRequest(String Destino, ZtyEE070[]& EtRequestHeader, ZtyEE071[]& EtRequestObj, Zclrqstdat IClrqst, Zrequest[]& TRequest) in D:\Documents and Settings\apacay\My Documents\Visual Studio 2005\Projects\Desarrollo SCM\scm.manager\SCM.Manager\Web References\mx.com.hylsamex.hmxwasd1\Reference.cs:line 85
   at SCM.Manager.SAPDataMockUp.SendOTs() in D:\Documents and Settings\apacay\My Documents\Visual Studio 2005\Projects\Desarrollo SCM\scm.manager\SCM.Manager\SAPDataMockUp.cs:line 164
   at SCM.Manager.Threads.HandleSap.Send() in D:\Documents and Settings\apacay\My Documents\Visual Studio 2005\Projects\Desarrollo SCM\scm.manager\SCM.Manager\Threads\HandleSap.cs:line 24
   at SCM.Manager.Front.Main(String[] args) in D:\Documents and Settings\apacay\My Documents\Visual Studio 2005\Projects\Desarrollo SCM\scm.manager\SCM.Manager\Front.cs:line 170
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Upvotes: 2

Views: 2485

Answers (0)

Related Questions