Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: changed some typo errors and replaced org.objectweb.celtix with org.apache.cxf

...

Code Block
titleExample 4:Setting a Request Context Property on the Client Side
// Set request context property.
java.util.Map&lt;StringMap<String, Object&gt;Object> requestContext =
  ((javax.xml.ws.BindingProvider)port).getRequestContext();
requestContext.put(ContextPropertyName, PropertyValue);

// Invoke an operation.
port.SomeOperation();

...

Code Block
titleExample 5:Reading a Response Context Property on the Client Side
// Invoke an operation.
port.SomeOperation();

// Read response context property.
java.util.Map&lt;StringMap<String, Object&gt;Object> responseContext =
  ((javax.xml.ws.BindingProvider)port).getResponseContext();
PropertyType propValue = (PropertyType) responseContext.get(ContextPropertyName);

...

Context Property Name

Context Property Type

org.objectwebapache.celtixcxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES

org.objectwebapache.celtixcxf.ws.addressing.AddressingProperties

...

  • Non-blocking polling — before attempting to get the result, check whether the response has arrived by calling the non-blocking
    Response<T>.isDone() method. For example:
    Code Block
    Response&lt;GreetMeSometimeResponse&gt;Response<GreetMeSometimeResponse> greetMeSomeTimeResp = ...;
    
    if (greetMeSomeTimeResp.isDone()) {
      GreetMeSometimeResponse reply = greetMeSomeTimeResp.get();
    }
    
  • Blocking polling — call Response<T>.get() right away and block until the response arrives (optionally specifying a timeout). For example, to poll for a response, with a 60 second timeout:
    Code Block
    Response&lt;GreetMeSometimeResponse&gt;Response<GreetMeSometimeResponse> greetMeSomeTimeResp = ...;
    
    GreetMeSometimeResponse reply = greetMeSomeTimeResp.get(
      60L,
      java.util.concurrent.TimeUnit.SECONDS
      );
    

...