KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > ws > handler > soap > SOAPMessageContext


1 /*
2  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.ws.handler.soap;
7
8 import javax.xml.soap.SOAPMessage JavaDoc;
9 import javax.xml.bind.JAXBContext;
10 import javax.xml.namespace.QName JavaDoc;
11 import java.util.Set JavaDoc;
12
13 /** The interface <code>SOAPMessageContext</code>
14  * provides access to the SOAP message for either RPC request or
15  * response. The <code>javax.xml.soap.SOAPMessage</code> specifies
16  * the standard Java API for the representation of a SOAP 1.1 message
17  * with attachments.
18  *
19  * @see javax.xml.soap.SOAPMessage
20  *
21  * @since JAX-WS 2.0
22 **/

23 public interface SOAPMessageContext
24                     extends javax.xml.ws.handler.MessageContext {
25
26   /** Gets the <code>SOAPMessage<code> from this message context. Modifications
27    * to the returned <code>SOAPMessage</code> change the message in-place, there
28    * is no need to susequently call <code>setMessage</code>.
29    *
30    * @return Returns the <code>SOAPMessage</code>; returns <code>null</code> if no
31    * <code>SOAPMessage</code> is present in this message context
32   **/

33   public SOAPMessage JavaDoc getMessage();
34
35   /** Sets the SOAPMessage in this message context
36    *
37    * @param message SOAP message
38    * @throws WebServiceException If any error during the setting
39    * of the <code>SOAPMessage</code> in this message context
40    * @throws java.lang.UnsupportedOperationException If this
41    * operation is not supported
42   **/

43   public void setMessage(SOAPMessage JavaDoc message);
44
45   /** Gets headers that have a particular qualified name from the message in the
46    * message context. Note that a SOAP message can contain multiple headers
47    * with the same qualified name.
48    *
49    * @param header The XML qualified name of the SOAP header(s).
50    * @param context The JAXBContext that should be used to unmarshall the
51    * header
52    * @param allRoles If <code>true</code> then returns headers for all SOAP
53    * roles, if <code>false</code> then only returns headers targetted
54    * at the roles currently being played by this SOAP node, see
55    * <code>getRoles</code>.
56    * @return An array of unmarshalled headers; returns an empty array if no
57    * message is present in this message context or no headers match
58    * the supplied qualified name.
59    * @throws WebServiceException If an error occurs when using the supplied
60    * <code>JAXBContext</code> to unmarshall. The cause of
61    * the <code>WebServiceException</code> is the original <code>JAXBException</code>.
62   **/

63   public Object JavaDoc[] getHeaders(QName JavaDoc header, JAXBContext context,
64     boolean allRoles);
65
66   /** Gets the SOAP actor roles associated with an execution
67    * of the handler chain.
68    * Note that SOAP actor roles apply to the SOAP node and
69    * are managed using {@link javax.xml.ws.soap.SOAPBinding#setRoles} and
70    * {@link javax.xml.ws.soap.SOAPBinding#getRoles}. <code>Handler</code> instances in
71    * the handler chain use this information about the SOAP actor
72    * roles to process the SOAP header blocks. Note that the
73    * SOAP actor roles are invariant during the processing of
74    * SOAP message through the handler chain.
75    *
76    * @return Array of <code>String</code> for SOAP actor roles
77   **/

78   public Set JavaDoc<String JavaDoc> getRoles();
79 }
80
Popular Tags