Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem deserializing soap message on call back
    primarykey
    data
    text
    <p>I am implementing a WCF .NET service that is called back by another service.<br> The soap message that the call back service sends back is below </p> <h2>The SOAP Message</h2> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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"&gt; &lt;soapenv:Body&gt; &lt;ns1:getAccountBalance soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://service.company.x.y"&gt; &lt;param0 xsi:type="xsd:string"&gt;123-K&lt;/param0&gt; &lt;param1 xsi:type="xsd:string"&gt;551003&lt;/param1&gt; &lt;param2 xsi:type="xsd:string"&gt;123&lt;/param2&gt; &lt;param3 xsi:type="xsd:string"&gt;1231&lt;/param3&gt; &lt;param4 xsi:type="xsd:string"&gt;ug&lt;/param4&gt; &lt;param5 xsi:type="xsd:string"&gt;x&lt;/param5&gt; &lt;param6 xsi:type="xsd:string"&gt;1.0&lt;/param6&gt; &lt;/ns1:getAccountBalance&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <h2>The WCF contract to receive the messae </h2> <pre><code> [OperationContract(Action="")] AccountEnquiryResponse getAccountBalance(String param0, String param1, String param2, String param3, String param4, String param5, String param6); </code></pre> <h2>The service implilmentation</h2> <pre><code>[ServiceBehavior(Namespace = "http://service.company.x.y")] public class MyService:IService { public AccountEnquiryResponse getAccountBalance(String param0, String param1, String param2, String param3, String param4, String param5, String param6) { return new AccountEnquiryResponse </code></pre> <h2>The problem</h2> <p>When the call back returns the WCF service is unable to deserialize the SOAP message parameters - they are all <b>null</b> </p> <h2>A soap message that works</h2> <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;getAccountBalance xmlns="http://service.company.x.y"&gt; &lt;param0&gt;123&lt;/param0&gt; &lt;param1&gt;123&lt;/param1&gt; &lt;param2&gt;uid&lt;/param2&gt; &lt;param3&gt;pwd&lt;/param3&gt; &lt;param4&gt;en&lt;/param4&gt; &lt;param5&gt;ug&lt;/param5&gt; &lt;param6&gt;1.0&lt;/param6&gt; &lt;/getAccountBalance&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <h2>My conclusion </h2> <p>The difference between the SOAP message that works and the one that does not work are the properties <em>soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/</em>" and <em>xsi:type="xsd:string</em> on the parameters and .NET is unable to deserialize the object properly because of them. </p> <p>Is that true? </p> <p>What can i do to solve this problem?</p> <p>PS. the service that calls me back is a third party application written in JAVA and I have no control over the message format that is sent back to my application. </p> <p>Please advise</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload