title: SOAP Connection Reset
body: <p>I successfully used the weimport maven tool generated the Jar file against the client WSD, which is backed by a .net SOAP service</p>
  
  <p>when I making a request from my java client code, I am getting the following log</p>
  
  <pre><code>Accept: text/xml, multipart/related
  Content-Type: multipart/related;start="&lt;rootpart*dbea05e3-9997-4835-965c-02b1ed77e6b6@example.jaxws.sun.com&gt;";type="application/xop+xml";boundary="uuid:dbea05e3-9997-4835-965c-02b1ed77e6b6";start-info="text/xml"
  SOAPAction: "http://xxx/2013/xxx/RemotexxxService/UpdateProfile"
  User-Agent: JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b
  --uuid:dbea05e3-9997-4835-965c-02b1ed77e6b6
  Content-Id: &lt;rootpart*dbea05e3-9997-4835-965c-02b1ed77e6b6@example.jaxws.sun.com&gt;
  Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
  Content-Transfer-Encoding: binary
  </code></pre>
  
  <p>and I am getting the following error</p>
  
  <pre><code>javax.xml.ws.WebServiceException: java.net.SocketException: Connection reset
      at com.sun.xml.ws.transport.http.client.HttpClientTransport.readResponseCodeAndMessage(HttpClientTransport.java:210)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:241)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:232)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:145)
      at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:110)
      at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
      at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
      at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
      at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
      at com.sun.xml.ws.client.Stub.process(Stub.java:463)
      at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:191)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
      at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
  </code></pre>
  
  <p>however when I copy past the entire SOAP message and try it in the SOAPUI, it does work..</p>
  
  <p>I have noticed the SOAP UI has different http header generated</p>
  
  <pre><code>POST http://coreservices-uat.legendonlineservices.co.uk/IRemoteContactUpdateService.svc HTTP/1.1
  Accept-Encoding: gzip,deflate
  Content-Type: text/xml;charset=UTF-8
  SOAPAction: "http://Infrastructure/2013/ContactPhoto/RemoteContactUpdateService/UpdateProfile"
  Content-Length: 1761
  Host: coreservices-uat.legendonlineservices.co.uk
  Connection: Keep-Alive
  User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
  </code></pre>
  
  <p>I can't think the Java version or difference between Apache-Httpclient or Jasws implementation would make any difference</p>
  
  <p>could it be the Content-Type? I mean in SOAP UI the content-type is 
  different to the Java client</p>
  
  <p>could it be the following definition in the wsdl causing the problem?</p>
  
  <pre><code>&lt;wsp:Policy wsu:Id="BasicHttpBinding_RemoteContactUpdateService_policy"&gt;
  &lt;wsp:ExactlyOne&gt;
  &lt;wsp:All&gt;
  &lt;wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/&gt;
  &lt;/wsp:All&gt;
  &lt;/wsp:ExactlyOne&gt;
  &lt;/wsp:Policy&gt;
  </code></pre>
  
  <p>Note: I was send the same XML message to the server using the same Java code couple of days ago, and it always works.... this is a recent error.  </p>