Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot parse MTOM response
    primarykey
    data
    text
    <p>I am utilizing a third party web service that is returning an object with a PDF attached using the MTOM encoding.</p> <p>The object is structured as <code>Data[]</code> with each array element having fields <code>ContentType</code> and <code>Include</code>.</p> <p>When I run the web service method, it completes the request fine, but it doesn't parse the response properly as the Include field gets parsed as <code>null</code>.</p> <p>When I run Fiddler, I can actually see the remote web service returning a response with all the fields available.</p> <p>This is what is sent in the SOAP:</p> <pre class="lang-xml prettyprint-override"><code>&lt;m:GetDocImageResponse&gt; &lt;x:data&gt; &lt;x:item xmime5:contentType="*/*"&gt; &lt;xop:Include href="cid:id1"/&gt;&lt;/x:item&gt; &lt;/x:data&gt; &lt;/m:GetDocImageResponse&gt; </code></pre> <p>I see that <code>Include</code> has the property called <code>href</code> and this contains a reference to binary PDF document.</p> <p>I am trying to parse the object according to WSDL:</p> <pre><code>Data[] retObject = null; using (blahWS ws = new blahWS()) { try{ retObject = ws.GetDoc(parameters); //request completes with no errors, but `Include` is parse as null [...] } catch {..} } </code></pre> <p>The web service reference is used with a simple <code>basicHttpBinding</code></p> <pre class="lang-xml prettyprint-override"><code>&lt;basicHttpBinding&gt; &lt;binding name="BasicHTTPwithMTOM" messageEncoding="Mtom" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" textEncoding="utf-8" /&gt; &lt;/basicHttpBinding&gt; </code></pre> <p>Should I be parsing the response differently? Why is it not parsing the fields?</p> <p>EDIT:</p> <p>Full SOAP Response:</p> <pre class="lang-xml prettyprint-override"><code>HTTP/1.1 200 OK Server: gSOAP/2.7 Content-Type: multipart/related; charset=utf-8; boundary="==nGpzR/KspN6ry7jG8CU4bonN2aujzfJamyN3xYjaldFXYpeUryNGb0UROC0B=="; type="application/xop+xml"; start="&lt;SOAP-ENV:Envelope&gt;"; start-info="text/xml" Content-Length: 180557 Connection: close --==nGpzR/KspN6ry7jG8CU4bonN2aujzfJamyN3xYjaldFXYpeUryNGb0UROC0B== Content-Type: application/xop+xml; charset=utf-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: &lt;SOAP-ENV:Envelope&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:m="http://www.mcleodsoftware.com/wsdl/ws4v.wsdl" xmlns:x="http://www.mcleodsoftware.com/schemas/ws4v.xsd"&gt; &lt;SOAP-ENV:Body&gt; &lt;m:GetDocImageResponse&gt; &lt;x:data&gt; &lt;x:item xmime5:contentType="*/*"&gt; &lt;xop:Include href="cid:id1"/&gt;&lt;/x:item&gt; &lt;/x:data&gt; &lt;/m:GetDocImageResponse&gt; &lt;/SOAP-ENV:Body&gt; </code></pre> <p></p> <pre class="lang-none prettyprint-override"><code>--==nGpzR/KspN6ry7jG8CU4bonN2aujzfJamyN3xYjaldFXYpeUryNGb0UROC0B== Content-Type: */* Content-Transfer-Encoding: binary Content-ID: &lt;id1&gt; ...binary... </code></pre> <p>Data definition built using the WSDL provided:</p> <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.mcleodsoftware.com/schemas/ws4v.xsd")] public partial class Data : object, System.ComponentModel.INotifyPropertyChanged { private Include includeField; private string contentTypeField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.w3.org/2004/08/xop/include", Order=0)] public Include Include { get { return this.includeField; } set { this.includeField = value; this.RaisePropertyChanged("Include"); } } </code></pre>
    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