Register / Login
JAXWS w/ WS Addressing
posted 6 years ago
My use case is as follows, I have a web service and client. The web service will take many hours to execute, my client will be disconnected by a firewall if the socket stays open that long.
I would like to use ws-addressing to allow the client to be responded asynchronously. I've followed this example:
Only instead of a say hello method I sleep for 30 seconds and return an a resultType.
However using netstat I see the the socket is established and stays alive the duration of the of the call.
Looking at the message I see that the request is using wsaddressing only with an anonymous address
<?xml version="1.0" encoding="UTF-8" standalone="no"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8085/PrintServer</To><Action xmlns="http://www.w3.org/2005/08/addressing">http://print/PrintServer/addRequest</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing"> <Address>http://www.w3.org/2005/08/addressing/anonymous</Address> </ReplyTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:6f712318-598b-4a8e-ae59-7eb2cc3267d0</MessageID></S:Header><S:Body><addInput xmlns="http://print"><arg0>0</arg0><arg1>0</arg1></addInput></S:Body></S:Envelope>
After some research I found the wsdl element that disallows anonymous addressing hoping that the client would form the message as necessary.
However this produces an error when I run the client as follows:
Exception in thread "main" javax.xml.ws.WebServiceException: Operation has "prohibited" value for wsaw:anonymous in the WSDL, Addressing must be disabled and SOAP message need to be hand-crafted
Is ws-addressing what I want? And is there some thing more the example needs to do async communication?
I can post my code if need be,
How do I set WS-Addressing ReplyTo header to NON-anonymous value
Error with SOAP 1.1
Problem while Encrypting SOAP body using Metro
WS-Addressing 2005/08 in JAX-WS
Interoperability between WCF and WSIT