-
1. Re: WS-Addressing + decoupled responses + http conduit timeout
gllambi Mar 14, 2014 10:12 AM (in response to gllambi)Hi guys!
I found the following properties to set the Addressing headers and:
- Client sends correctly replyTo header
- Service responds correctly an http 202 to the client
- Service responds correctly to the replyTo address
- ReplyToEndpoint receives correctly the answer
- Client throws a timeout error
any idea about this?
here's the properties settings:
AddressingSampleImplService service = new AddressingSampleImplService(); AddressingSample port = service.getAddressingSampleImplPort(new AddressingFeature()); BindingProvider bp = (BindingProvider)port; AddressingProperties props = new AddressingPropertiesImpl(); EndpointReferenceType ref = new EndpointReferenceType(); AttributedURIType wsaReplyToURI = new AttributedURIType(); wsaReplyToURI.setValue(replyTo); ref.setAddress(wsaReplyToURI); props.setReplyTo(ref); AttributedURIType messageID = new AttributedURIType(); messageID.setValue("urn:uuid:"+UUIDGenerator.generateRandomUUIDString()); props.setMessageID(messageID); bp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, props);
I also removed the http-conduit from the cxf.xml
thanks in advance!
Guzman
-
2. Re: WS-Addressing + decoupled responses + http conduit timeout
asoldano Mar 24, 2014 5:28 AM (in response to gllambi)1 of 1 people found this helpfulGuzman,
if you haven't already, consider looking at http://anonsvn.jboss.org/repos/jbossws/stack/cxf/tags/jbossws-cxf-4.3.0.Final/modules/testsuite/cxf-tests/src/test/java/… (a testcase on WS-Addressing with decoupled endpoints too)
-
3. Re: Re: WS-Addressing + decoupled responses + http conduit timeout
gllambi Apr 19, 2014 3:42 PM (in response to asoldano)Hi Alessio!
thanks for the answer and sorry for the long reply but just now I could return to this.
I looked at the code and helped me to worked it out. This is the final client code:
AddressingSampleImplService service1 = new AddressingSampleImplService(); AddressingSample port1 = service1.getAddressingSampleImplPort(new AddressingFeature(true, true)); Client client = ClientProxy.getClient(port); HTTPConduit conduit = (HTTPConduit)client.getConduit(); HTTPClientPolicy policy = conduit.getClient(); //set low connection and receive timeouts to ensure the http client can't keep the connection open till the response is received policy.setConnectionTimeout(5000); //5 secs policy.setReceiveTimeout(10000); //10 secs ((ClientImpl)client).setSynchronousTimeout(120000); policy.setDecoupledEndpoint("http://localhost:18181/jaxws-samples-wsa/decoupled-endpoint"); int result = port1.add(1, 2); System.out.println("Result: "+result); System.out.println("Call Over!");
The key code is this one:
((ClientImpl)client).setSynchronousTimeout(120000);
Is there a way to have this same configuration but not to use the HTTPConduit? for example, sending the response to another WS in another server? Maybe using AddressingProperties?
thanks
Guzmán
-
4. Re: Re: WS-Addressing + decoupled responses + http conduit timeout
asoldano Apr 24, 2014 8:23 AM (in response to gllambi)Guzman LlambiÂas wrote:
The key code is this one:
- ((ClientImpl)client).setSynchronousTimeout(120000);
Is there a way to have this same configuration but not to use the HTTPConduit? for example, sending the response to another WS in another server? Maybe using AddressingProperties?
mmh... not really, sorry, this is a CXF impl detail.