title: Soap response, not well formed XML, no XOP parts located, using WSE
body: <p>I am consuming a web service in which I send off a request with an attachment and we receive a response from the server with various information. I have documented some problems with getting the request together in another question <a href="https://stackoverflow.com/questions/8574938/adding-an-attachment-to-soap-request">Adding an attachment to SOAP request</a> but this bit has been resolved and now another problem has cropped up on the response.</p>
  
  <p>We receive the response ok but an error is thrown stating: </p>
  
  <blockquote>
    <p>Response is not well-formed XML.</p>
  </blockquote>
  
  <p>The InnerException is:</p>
  
  <blockquote>
    <p>WSE1608: No XOP parts were located in the stream for the specified content-id: &lt;rootpart*36875c60-630c-4e23-9e74-f9a9c7547fc7@example.jaxws.sun.com&gt;</p>
  </blockquote>
  
  <p>The xml that is returned looks like:</p>
  
  <pre><code>--uuid:36875c60-630c-4e23-9e74-f9a9c7547fc7
  Content-Type: application/xop+xml;charset=utf-8;type="text/xml";
  Content-ID: &lt;rootpart*36875c60-630c-4e23-9e74-f9a9c7547fc7@example.jaxws.sun.com&gt;
  content-transfer-encoding: binary
  
    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;soapenv:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
        &lt;payloadManifest xmlns="http://(namespace)"&gt;
          &lt;manifest contentID="content0" element="ProcessAttachment" namespaceURI="http://(namespace)" version="2.01"/&gt;
        &lt;/payloadManifest&gt;
      &lt;/soapenv:Header&gt;
      &lt;soapenv:Body&gt;
        &lt;tran:ProcessMessageResponse xmlns="http://(namespace)" xmlns:ns2="http://(ns2Namespace)" xmlns:ns3="http://(ns3Namespace)" xmlns:tran="http://(tranNamespace)"&gt;
          &lt;tran:payload&gt;
            &lt;tran:content id="content0"&gt;
              &lt;s:ShowServiceProcessingAdvisory xmlns:s="http://(sNamespace)"&gt;
                &lt;s:ApplicationArea&gt;
                  &lt;s:Sender&gt;
                    &lt;s:Component&gt;Global Warranty Management&lt;/s:Component&gt;
                    &lt;s:Task&gt;ShowAttachments&lt;/s:Task&gt;
                    &lt;s:CreatorNameCode&gt;Creator&lt;/s:CreatorNameCode&gt;
                    &lt;s:SenderNameCode&gt;GM&lt;/s:SenderNameCode&gt;
                  &lt;/s:Sender&gt;
                  &lt;s:CreationDateTime&gt;2012-01-10T12:58:27Z&lt;/s:CreationDateTime&gt;
                  &lt;s:Destination&gt;
                    &lt;s:DestinationNameCode&gt;XX&lt;/s:DestinationNameCode&gt;
                    &lt;s:DealerNumber&gt;234567&lt;/s:DealerNumber&gt;
                    &lt;s:DealerCountry&gt;US&lt;/s:DealerCountry&gt;
                  &lt;/s:Destination&gt;
                &lt;/s:ApplicationArea&gt;
                &lt;s:DataArea&gt;
                  &lt;s:Show/&gt;
                  &lt;s:ServiceProcessingAdvisory&gt;
                    &lt;s:Header&gt;
                      &lt;s:SecondaryDealerNumber&gt;253909&lt;/s:SecondaryDealerNumber&gt;
                      &lt;s:Disposition&gt;
                        &lt;s:RepairOrder&gt;
                          &lt;s:WarrantyClaim xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:WarrantyClaimExtended"&gt;
                            &lt;s:OEMClaimNumber&gt;00112233445566778899&lt;/s:OEMClaimNumber&gt;
                            &lt;gwm:Attachment xmlns:gwm="http://(gwmNamespace)"&gt;
                              &lt;gwm:AttachmentId&gt;5678987&lt;/gwm:AttachmentId&gt;
                              &lt;gwm:Filename&gt;14.jpg&lt;/gwm:Filename&gt;
                            &lt;/gwm:Attachment&gt;
                          &lt;/s:WarrantyClaim&gt;
                        &lt;/s:RepairOrder&gt;
                      &lt;/s:Disposition&gt;
                    &lt;/s:Header&gt;
                  &lt;/s:ServiceProcessingAdvisory&gt;
                &lt;/s:DataArea&gt;
              &lt;/s:ShowServiceProcessingAdvisory&gt;
            &lt;/tran:content&gt;
          &lt;/tran:payload&gt;
        &lt;/tran:ProcessMessageResponse&gt;
      &lt;/soapenv:Body&gt;
    &lt;/soapenv:Envelope&gt;
  
    --uuid:36875c60-630c-4e23-9e74-f9a9c7547fc7--
  </code></pre>
  
  <p>I'm assuming this is an error due to the MIME parts, but how should this be handled?</p>
  
  <p>Might I just add that this is the exact same XML returned in SoapUI and is the expected returned XML. Also, I might add that WSE is required for 2 reasons, because the third party developer of the web service refuses to change their working methods, and we also have a reliance on VS 2005 and therefore can't utilise WCF, espaecially with a deadline hanging over us.</p>
  
  <p>EDIT: The actual response I receive is below, I formatted it above for ease of reading</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Mon, 16 Jan 2012 09:44:22 GMT
  Server: ACE XML Gateway
  Cache-Control: no-cache="Set-Cookie"
  Set-Cookie: JSESSIONID=h3LnPTxYdZJ3wp4zFl2GV3BYQ7fZD1p8WbvPgl1Qq95g1F9GQhMC!1396094632; path=/
  X-Powered-By: Servlet/2.5 JSP/2.1
  Content-Type: multipart/related; type="application/xop+xml";  boundary="uuid:a9a94e4e-5134-4995-8884-dfd4d65b7784"; start="&lt;rootpart*a9a94e4e-5134-4995-8884-dfd4d65b7784@example.jaxws.sun.com&gt;"; start-info="text/xml"
  Content-Length: 2296
  Keep-Alive: timeout=15, max=100
  Connection: Keep-Alive
  
  
  --uuid:a9a94e4e-5134-4995-8884-dfd4d65b7784
  Content-Type: application/xop+xml;charset=utf-8;type="text/xml";
  Content-ID: &lt;rootpart*a9a94e4e-5134-4995-8884-dfd4d65b7784@example.jaxws.sun.com&gt;
  content-transfer-encoding: binary
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soapenv:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;payloadManifest xmlns="http://www.starstandards.org/webservices/2005/10/transport"&gt;&lt;manifest contentID="content0" element="ProcessAttachment" namespaceURI="http://www.starstandards.org/STAR" version="2.01"/&gt;&lt;/payloadManifest&gt;&lt;/soapenv:Header&gt;&lt;soapenv:Body&gt;&lt;tran:ProcessMessageResponse xmlns="http://www.starstandards.org/STAR" xmlns:ns2="http://www.gm.com/2006/GWM" xmlns:ns3="http://www.starstandards.org/webservices/2005/10/transport" xmlns:tran="http://www.starstandards.org/webservices/2005/10/transport"&gt;&lt;tran:payload&gt;&lt;tran:content id="content0"&gt;&lt;s:ShowServiceProcessingAdvisory xmlns:s="http://www.starstandards.org/STAR"&gt;&lt;s:ApplicationArea&gt;&lt;s:Sender&gt;&lt;s:Component&gt;Global Warranty Management&lt;/s:Component&gt;&lt;s:Task&gt;ShowAttachments&lt;/s:Task&gt;&lt;s:CreatorNameCode&gt;General Motors&lt;/s:CreatorNameCode&gt;&lt;s:SenderNameCode&gt;GM&lt;/s:SenderNameCode&gt;&lt;/s:Sender&gt;&lt;s:CreationDateTime&gt;2012-01-16T09:44:24Z&lt;/s:CreationDateTime&gt;&lt;s:Destination&gt;&lt;s:DestinationNameCode&gt;XX&lt;/s:DestinationNameCode&gt;&lt;s:DealerNumber&gt;253909&lt;/s:DealerNumber&gt;&lt;s:DealerCountry&gt;US&lt;/s:DealerCountry&gt;&lt;/s:Destination&gt;&lt;/s:ApplicationArea&gt;&lt;s:DataArea&gt;&lt;s:Show/&gt;&lt;s:ServiceProcessingAdvisory&gt;&lt;s:Header&gt;&lt;s:SecondaryDealerNumber&gt;253909&lt;/s:SecondaryDealerNumber&gt;&lt;s:Disposition&gt;&lt;s:RepairOrder&gt;&lt;s:WarrantyClaim xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:WarrantyClaimExtended"&gt;&lt;s:OEMClaimNumber&gt;001116695583&lt;/s:OEMClaimNumber&gt;&lt;gwm:Attachment xmlns:gwm="http://www.gm.com/2006/GWM"&gt;&lt;gwm:AttachmentId&gt;5677606&lt;/gwm:AttachmentId&gt;&lt;gwm:Filename&gt;1127.jpg&lt;/gwm:Filename&gt;&lt;/gwm:Attachment&gt;&lt;/s:WarrantyClaim&gt;&lt;/s:RepairOrder&gt;&lt;/s:Disposition&gt;&lt;/s:Header&gt;&lt;/s:ServiceProcessingAdvisory&gt;&lt;/s:DataArea&gt;&lt;/s:ShowServiceProcessingAdvisory&gt;&lt;/tran:content&gt;&lt;/tran:payload&gt;&lt;/tran:ProcessMessageResponse&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;
  
  --uuid:a9a94e4e-5134-4995-8884-dfd4d65b7784--
  </code></pre>