Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-470

Request and Response contexts are the no thread-local objects of the JaxWsClientProxy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-RC
    • 2.0-RC
    • JAX-WS Runtime
    • 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.

      Attachments

        Activity

          People

            njiang Willem Jiang
            njiang Willem Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: