locked
Attempting to Send SOAP Request results DataContract Serialization Error RRS feed

  • General discussion

  • I have a workflow implemented using WCF Framework 4.5 ; I am trying to send a SOAP request to the service using SOAP message via third partner (Client B)

    In order to do so I enabled message tracing on service level, coded a .NET Client (Client A) to issue message request and logged entire messages

    I tried to log the same message from Client B, but I faced serialization exception when DataContract attempts to resolve message body, I can't see much difference between two messages logged by WCF message tracing  

    Client A Message

    <MessageLogTraceRecord>
    <HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Connection>Keep-Alive</Connection>
    <Content-Length>240</Content-Length>
    <Content-Type>text/xml; charset=utf-8</Content-Type>
    <Accept-Encoding>gzip, deflate</Accept-Encoding>
    <Expect>100-continue</Expect>
    <Host>localhost:57103</Host>
    <VsDebuggerCausalityData>uIDPoyLbKfV1CadKh5t3ZjfEnu4AAAAA3GxK9sSUPk66F80RsnvVzGYIXx7AhYNKhngjn/Q1BvcACQAA</VsDebuggerCausalityData>
    <SOAPAction>"http://tempuri.org/IService/StartIssue"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <h:SurveyId xmlns:h="http://tempuri.org/">1</h:SurveyId>
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:57103/F3IssueService.xamlx</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IService/StartIssue</Action>
    </s:Header>
    <s:Body>
    <F3Issue xmlns="http://tempuri.org/">
    <Priority>0</Priority>
    </F3Issue>
    </s:Body>
    </s:Envelope>
    </MessageLogTraceRecord>


    Client B Message

    <MessageLogTraceRecord>
    <HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Connection>Keep-Alive</Connection>
    <Content-Length>273</Content-Length>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Expect>100-continue</Expect>
    <Host>localhost:57103</Host>
    <SOAPAction>"http://tempuri.org/IService/StartIssue"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <h:SurveyId xmlns:h="http://tempuri.org/">1</h:SurveyId>
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:57103/F3IssueService.xamlx</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IService/StartIssue</Action>
    </s:Header>
    <s:Body>
    <F3Issue xmlns="http://tempuri.org/">
    <Priority>1</Priority>
    </F3Issue></s:Body>
    </s:Envelope>
    </MessageLogTraceRecord>

    Exception

    Message: - OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'F3Issue' and namespace 'http://tempuri.org/

    StackTrace:-

    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[]parameters, Boolean isRequest)at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[]parameters, Boolean isRequest)at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[]parameters)

    Monday, September 30, 2013 10:07 PM

All replies

  • Webservices require unique namespaces, according to error message, the namespace is not declared.  

    Thursday, October 3, 2013 6:10 AM