Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-RC
-
None
Description
The CXF documentation at http://cwiki.apache.org/CXF20DOC/developing- a-consumer.html illustrates a pattern for implementing a CXF client. Under the section "Setting a request context" and "Reading a response context", the following code is presented:
{{{
// Set request context property.
java.util.Map<String, Object> requestContext =
((javax.xml.ws.BindingProvider)port).getRequestContext();
requestContext.put(ContextPropertyName, PropertyValue);
// Invoke an operation.
port.SomeOperation();
// Read response context property.
java.util.Map<String, Object> responseContext =
((javax.xml.ws.BindingProvider)port).getResponseContext();
PropertyType propValue = (PropertyType) responseContext.get (ContextPropertyName);
}}}
The port is the instance of JaxWsClientProxy which implements the BindingProvider interface.
The RequestContext and the ResponseContext should be thread safe for multi-thread share the same client proxy to gain better scability.