JAXWS: Support Binding Property to Access SOAPHeaders
------------------------------------------------------
Key: AXIS2-3708
URL: https://issues.apache.org/jira/browse/AXIS2-3708
Project: Axis 2.0 (Axis2)
Issue Type: Improvement
Components: jaxws
Affects Versions: 1.4
Reporter: Rich Scheuerle
Assignee: Rich Scheuerle
Background:
------------------
The JAX-WS specification defines properties to set/get attachments on the
dispatch/proxy. For example:
// Create Dispatch for the payload
Dispatch<String> dispatch =
svc.createDispatch(portName, String.class,
Service.Mode.PAYLOAD);
// Get the request context
Map<String, Object> requestContext = dispatch.getRequestContext();
// Get the attachments (non-payload) that should also be sent.
Map<String, DataHandler> attachmentMap = new HashMap();
attachmentMap.put("javax.xml.ws.binding.attachments.outbound",
myDataHandler);
// Attach the attachments to the request context
dispatch.getRequestContext().put("javax.xml.ws.binding.attachments.outbound",
attachmentMap);
The "javax.xml.ws.binding.attachments.*" properties make it convenient to
get/receive attachments.
Proposal:
----------
The proposal is to add the same kind of functionality to get/set SOAP Headers.
For example:
// Create Dispatch for the payload
Dispatch<String> dispatch =
svc.createDispatch(portName, String.class,
Service.Mode.PAYLOAD);
// Get the request context
Map<String, Object> requestContext = dispatch.getRequestContext();
// Create a new outbound header
Map<QName, List<String>> headerMap = new HashMap();
List<String> myHeadersList = new ArrayList<String>();
myHeadersList.add("<pre:sample
xmlns:pre="http://sample">hello</pre:sample>";
QName myHeaderQName = new QName("http://sample", "sample", "pre");
headersMap.put(myHeaderQName, myHeadersList );
// Attach the headers map to the request context
dispatch.getRequestContext().put("jaxws.binding.soap.headers.outbound",
headerMap);
Details:
--------
Proposed names:
"jaxws.binding.soap.headers.outbound" and
"jaxws.binding.soap.headers.inbound".
This is similar naming convention as the existing attachment properties
Proposed value:
Map<QName, List<String>>
QName is the qname of the header(s)
List<String> is a list of xml values (normally one)
String is the xml string for a single header.
(The object is a String. Most JAXWS users will not be familiar with
OM and may not want to build a SAAJ SOAPHeader).
Semantics for "jaxws.binding.soap.headers.outbound":
Prior to the dispatch/proxy invocation:
The customer sets the outbound map on the RequestContext.
During the dispatch/proxy invocation:
The outbound jaxws engine adds the headers to the message.
Semantics for "jaxws.binding.soap.headers.inbound"
During the dispatch/proxy invocation:
The engine will provide a map<QName, List<String>> on the
ResponseContext.
After the dispatch/proxy invocation:
The customer accesses the inbound headers map from the ResponseContext.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]