I have a running web service connection between a Java client program with the Metro {2.2.1-1} web service stack and a WCF {.NET 4.0 v30319} wsHttpBinding web service on Windows XP SP3.
If I move the exact same setup to a Windows 7 {with some enterprise setup} or Windows 2008 R2 Server SP1 {from MS DVD}, I get hanging requests from the Java client to the WCF service. I.e. there are no symptoms of any data exchange between the two partners {I have -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true on the client side and diagnostic print messages on the server side -- both without output}. Networkologically, a TCP connection is open ("netstat -a") until a timeout occurs after 200+-5 seconds with the following stack trace:
Jul 19, 2013 12:13:00 PM ch.xxxxxxxx.xxxxx.balance.client.start.Start main
SEVERE: null
com.sun.xml.ws.streaming.XMLStreamReaderException: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:326)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:99)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextContent(XMLStreamReaderUtil.java:169)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextElementContent(XMLStreamReaderUtil.java:104)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.java:584)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:470)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseImport(RuntimeWSDLParser.java:427)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseImport(RuntimeWSDLParser.java:835)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:464)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:232)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:192)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:161)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:328)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:290)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:199)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
at javax.xml.ws.Service.<init>(Unknown Source)
at ch.xxxxxxxx.xxxxx.balance.client.SystemIntegrationServiceBridge.<init>(SystemIntegrationServiceBridge.java:50)
at ch.xxxxxxxx.xxxxx.balance.client.start.Start.main(Start.java:37)
Caused by: com.ctc.wstx.exc.WstxIOException: Connection reset
at com.ctc.wstx.sr.StreamScanner.constructFromIOE(StreamScanner.java:625)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1049)
at com.ctc.wstx.sr.StreamScanner.parseLocalName2(StreamScanner.java:1857)
at com.ctc.wstx.sr.StreamScanner.parseLocalName(StreamScanner.java:1817)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2925)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2817)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1065)
at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:96)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:80)
... 19 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at com.ctc.wstx.io.BaseReader.readBytes(BaseReader.java:155)
at com.ctc.wstx.io.UTF8Reader.loadMore(UTF8Reader.java:368)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:111)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:87)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1046)
... 26 more
If I terminate the service during this period, the client stops waiting with a similar stack trace immediately, and, as expected, no TCP connection is existing anymore.
Activating WCF logging (see http://msdn.microsoft.com/en-us/library/ms730064.aspx) shows a log according to which WCF thinks, it has delivered the three parts of the WSDL (/?wsdl, /?wsdl=wsdl0, /?wsdl=wsdl1) completely and successfully.
All is running as Administrator, UAC is switched off, it doesn't matter, if I have the firewall off or on or if I have IPv6 off or on. I tried JRE 7_u17 32bit, 7_u25 32bit and 7_u25 64bit.
SoapUI 4.5.1 perfectly communicates with the service locally on the win7-oid platform.
A WCF client communicates with the service locally and without proxy.
A small Java web service client using the Metro libraries, calling a corresponding WCF web service locally, works fine.
If I install the http proxy Fiddler on the win7-oid platforms and reconfigure my Java client app to use the proxy {-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888 -Dhttp.nonProxyHosts=""}, all is fine.
If the client side is on the XP box and the service on the W7oid one or the other way around, remotely accessing the WCF service works fine without any tricks.
Running out of imagination, what may be the cause for this strange behaviour, I'd like to ask the following questions:
- is there anybody out there, who experienced a similar problem
- any propositions, which Windows mechanism could interfere in the described manner
- any propositions, which other experiments I could take on to get nearer to a solution
- which additional diagnostic measures should I take to boil it down to the very problem [and the solution, I hope]