smokinmark
asked on
Calling WCF Service from Java -- Connection reset exceptions
Hello All,
A Java application is calling my WCF service. Once in a while they get the follow exception:
Connection reset; nested exception is java.net.SocketException: Connection resetorg.springframework.w s.client.W ebServiceI OException : I/O error: Connection reset; nested exception is java.net.SocketException: Connection reset
at org.springframework.ws.cli ent.core.W ebServiceT emplate.se ndAndRecei ve(WebServ iceTemplat e.java:543 )
at org.springframework.ws.cli ent.core.W ebServiceT emplate.ma rshalSendA ndReceive( WebService Template.j ava:384)
at org.springframework.ws.cli ent.core.W ebServiceT emplate.ma rshalSendA ndReceive( WebService Template.j ava:378)
This is the Java code being used to call the WCF Service:
public <T> T sendAndReceive(String uriString,
WebServiceMessageCallback requestCallback,
WebServiceMessageExtractor <T> responseExtractor) {
Assert.notNull(responseExt ractor, "'responseExtractor' must not be null");
Assert.hasLength(uriString , "'uri' must not be empty");
TransportContext previousTransportContext = TransportContextHolder.get TransportC ontext();
WebServiceConnection connection = null;
try {
connection = createConnection(URI.creat e(uriStrin g));
TransportContextHolder.set TransportC ontext(new DefaultTransportContext(co nnection)) ;
MessageContext messageContext = new DefaultMessageContext(getM essageFact ory());
return doSendAndReceive(messageCo ntext, connection, requestCallback, responseExtractor);
}
catch (TransportException ex) {
throw new WebServiceTransportExcepti on("Could not use transport: " + ex.getMessage(), ex);
}
catch (IOException ex) {
throw new WebServiceIOException("I/O error: " + ex.getMessage(), ex);
}
finally {
TransportUtils.closeConnec tion(conne ction);
TransportContextHolder.set TransportC ontext(pre viousTrans portContex t);
}
Any ideas?
A Java application is calling my WCF service. Once in a while they get the follow exception:
Connection reset; nested exception is java.net.SocketException: Connection resetorg.springframework.w
at org.springframework.ws.cli
at org.springframework.ws.cli
at org.springframework.ws.cli
This is the Java code being used to call the WCF Service:
public <T> T sendAndReceive(String uriString,
WebServiceMessageCallback requestCallback,
WebServiceMessageExtractor
Assert.notNull(responseExt
Assert.hasLength(uriString
TransportContext previousTransportContext = TransportContextHolder.get
WebServiceConnection connection = null;
try {
connection = createConnection(URI.creat
TransportContextHolder.set
MessageContext messageContext = new DefaultMessageContext(getM
return doSendAndReceive(messageCo
}
catch (TransportException ex) {
throw new WebServiceTransportExcepti
}
catch (IOException ex) {
throw new WebServiceIOException("I/O
}
finally {
TransportUtils.closeConnec
TransportContextHolder.set
}
Any ideas?
ASKER
Would you be willing to look at my web.config file for the WCF service?
Sorry - I'm not familiar with WCFs. I've just seen those exceptions a thousand times in writing network services that operate over the web.
Doug
Doug
ASKER
I'm beginning to wonder if this is an IIS thing.
I have traced this further in the Windows Event Logs.
"A process serving application pool 'XXX' suffered a fatal communication error with the Windows Process Activation Service. The process id was '1234'. The data field contains the error number."
I have traced this further in the Windows Event Logs.
"A process serving application pool 'XXX' suffered a fatal communication error with the Windows Process Activation Service. The process id was '1234'. The data field contains the error number."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As posted by me.
good
If this call is being placed over the internet this may simply be a network connection failure - somebody dropped the data along the chain between your servers.
However if the call is over a LAN you can probably assume the connection is reliable, in which case you should look for an error that's causing the communication to not complete - e.g. an exception being thrown part way through the message sending, which then prematurely causes the client to close the connection (or socket).
Doug