SOAPMessageContext (Java Platform SE 8 ) (original) (raw)
- All Superinterfaces:
Map<String,Object>, MessageContext
public interface SOAPMessageContext
extends MessageContext
The interface SOAPMessageContext
provides access to the SOAP message for either RPC request or response. The javax.xml.soap.SOAPMessage
specifies the standard Java API for the representation of a SOAP 1.1 message with attachments.
Since:
JAX-WS 2.0
See Also:
SOAPMessage
Nested Class Summary
* ### Nested classes/interfaces inherited from interface javax.xml.ws.handler.[MessageContext](../../../../../javax/xml/ws/handler/MessageContext.html "interface in javax.xml.ws.handler") `[MessageContext.Scope](../../../../../javax/xml/ws/handler/MessageContext.Scope.html "enum in javax.xml.ws.handler")` * ### Nested classes/interfaces inherited from interface java.util.[Map](../../../../../java/util/Map.html "interface in java.util") `[Map.Entry](../../../../../java/util/Map.Entry.html "interface in java.util")<[K](../../../../../java/util/Map.Entry.html "type parameter in Map.Entry"),[V](../../../../../java/util/Map.Entry.html "type parameter in Map.Entry")>`
Field Summary
* ### Fields inherited from interface javax.xml.ws.handler.[MessageContext](../../../../../javax/xml/ws/handler/MessageContext.html "interface in javax.xml.ws.handler") `[HTTP_REQUEST_HEADERS](../../../../../javax/xml/ws/handler/MessageContext.html#HTTP%5FREQUEST%5FHEADERS), [HTTP_REQUEST_METHOD](../../../../../javax/xml/ws/handler/MessageContext.html#HTTP%5FREQUEST%5FMETHOD), [HTTP_RESPONSE_CODE](../../../../../javax/xml/ws/handler/MessageContext.html#HTTP%5FRESPONSE%5FCODE), [HTTP_RESPONSE_HEADERS](../../../../../javax/xml/ws/handler/MessageContext.html#HTTP%5FRESPONSE%5FHEADERS), [INBOUND_MESSAGE_ATTACHMENTS](../../../../../javax/xml/ws/handler/MessageContext.html#INBOUND%5FMESSAGE%5FATTACHMENTS), [MESSAGE_OUTBOUND_PROPERTY](../../../../../javax/xml/ws/handler/MessageContext.html#MESSAGE%5FOUTBOUND%5FPROPERTY), [OUTBOUND_MESSAGE_ATTACHMENTS](../../../../../javax/xml/ws/handler/MessageContext.html#OUTBOUND%5FMESSAGE%5FATTACHMENTS), [PATH_INFO](../../../../../javax/xml/ws/handler/MessageContext.html#PATH%5FINFO), [QUERY_STRING](../../../../../javax/xml/ws/handler/MessageContext.html#QUERY%5FSTRING), [REFERENCE_PARAMETERS](../../../../../javax/xml/ws/handler/MessageContext.html#REFERENCE%5FPARAMETERS), [SERVLET_CONTEXT](../../../../../javax/xml/ws/handler/MessageContext.html#SERVLET%5FCONTEXT), [SERVLET_REQUEST](../../../../../javax/xml/ws/handler/MessageContext.html#SERVLET%5FREQUEST), [SERVLET_RESPONSE](../../../../../javax/xml/ws/handler/MessageContext.html#SERVLET%5FRESPONSE), [WSDL_DESCRIPTION](../../../../../javax/xml/ws/handler/MessageContext.html#WSDL%5FDESCRIPTION), [WSDL_INTERFACE](../../../../../javax/xml/ws/handler/MessageContext.html#WSDL%5FINTERFACE), [WSDL_OPERATION](../../../../../javax/xml/ws/handler/MessageContext.html#WSDL%5FOPERATION), [WSDL_PORT](../../../../../javax/xml/ws/handler/MessageContext.html#WSDL%5FPORT), [WSDL_SERVICE](../../../../../javax/xml/ws/handler/MessageContext.html#WSDL%5FSERVICE)`
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method Description Object[] getHeaders(QName header,JAXBContext context, boolean allRoles) Gets headers that have a particular qualified name from the message in the message context. SOAPMessage getMessage() Gets the SOAPMessage from this message context. Set<String> getRoles() Gets the SOAP actor roles associated with an execution of the handler chain. void setMessage(SOAPMessage message) Sets the SOAPMessage in this message context * ### Methods inherited from interface javax.xml.ws.handler.[MessageContext](../../../../../javax/xml/ws/handler/MessageContext.html "interface in javax.xml.ws.handler") `[getScope](../../../../../javax/xml/ws/handler/MessageContext.html#getScope-java.lang.String-), [setScope](../../../../../javax/xml/ws/handler/MessageContext.html#setScope-java.lang.String-javax.xml.ws.handler.MessageContext.Scope-)` * ### Methods inherited from interface java.util.[Map](../../../../../java/util/Map.html "interface in java.util") `[clear](../../../../../java/util/Map.html#clear--), [compute](../../../../../java/util/Map.html#compute-K-java.util.function.BiFunction-), [computeIfAbsent](../../../../../java/util/Map.html#computeIfAbsent-K-java.util.function.Function-), [computeIfPresent](../../../../../java/util/Map.html#computeIfPresent-K-java.util.function.BiFunction-), [containsKey](../../../../../java/util/Map.html#containsKey-java.lang.Object-), [containsValue](../../../../../java/util/Map.html#containsValue-java.lang.Object-), [entrySet](../../../../../java/util/Map.html#entrySet--), [equals](../../../../../java/util/Map.html#equals-java.lang.Object-), [forEach](../../../../../java/util/Map.html#forEach-java.util.function.BiConsumer-), [get](../../../../../java/util/Map.html#get-java.lang.Object-), [getOrDefault](../../../../../java/util/Map.html#getOrDefault-java.lang.Object-V-), [hashCode](../../../../../java/util/Map.html#hashCode--), [isEmpty](../../../../../java/util/Map.html#isEmpty--), [keySet](../../../../../java/util/Map.html#keySet--), [merge](../../../../../java/util/Map.html#merge-K-V-java.util.function.BiFunction-), [put](../../../../../java/util/Map.html#put-K-V-), [putAll](../../../../../java/util/Map.html#putAll-java.util.Map-), [putIfAbsent](../../../../../java/util/Map.html#putIfAbsent-K-V-), [remove](../../../../../java/util/Map.html#remove-java.lang.Object-), [remove](../../../../../java/util/Map.html#remove-java.lang.Object-java.lang.Object-), [replace](../../../../../java/util/Map.html#replace-K-V-), [replace](../../../../../java/util/Map.html#replace-K-V-V-), [replaceAll](../../../../../java/util/Map.html#replaceAll-java.util.function.BiFunction-), [size](../../../../../java/util/Map.html#size--), [values](../../../../../java/util/Map.html#values--)`
Method Detail
* #### getMessage [SOAPMessage](../../../../../javax/xml/soap/SOAPMessage.html "class in javax.xml.soap") getMessage() Gets the `SOAPMessage` from this message context. Modifications to the returned `SOAPMessage` change the message in-place, there is no need to subsequently call `setMessage`. Returns: Returns the `SOAPMessage`; returns `null` if no`SOAPMessage` is present in this message context * #### setMessage void setMessage([SOAPMessage](../../../../../javax/xml/soap/SOAPMessage.html "class in javax.xml.soap") message) Sets the SOAPMessage in this message context Parameters: `message` \- SOAP message Throws: `WebServiceException` \- If any error during the setting of the `SOAPMessage` in this message context `[UnsupportedOperationException](../../../../../java/lang/UnsupportedOperationException.html "class in java.lang")` \- If this operation is not supported * #### getHeaders [Object](../../../../../java/lang/Object.html "class in java.lang")[] getHeaders([QName](../../../../../javax/xml/namespace/QName.html "class in javax.xml.namespace") header, [JAXBContext](../../../../../javax/xml/bind/JAXBContext.html "class in javax.xml.bind") context, boolean allRoles) Gets headers that have a particular qualified name from the message in the message context. Note that a SOAP message can contain multiple headers with the same qualified name. Parameters: `header` \- The XML qualified name of the SOAP header(s). `context` \- The JAXBContext that should be used to unmarshall the header `allRoles` \- If `true` then returns headers for all SOAP roles, if `false` then only returns headers targetted at the roles currently being played by this SOAP node, see`getRoles`. Returns: An array of unmarshalled headers; returns an empty array if no message is present in this message context or no headers match the supplied qualified name. Throws: `WebServiceException` \- If an error occurs when using the supplied`JAXBContext` to unmarshall. The cause of the `WebServiceException` is the original `JAXBException`. * #### getRoles [Set](../../../../../java/util/Set.html "interface in java.util")<[String](../../../../../java/lang/String.html "class in java.lang")> getRoles() Gets the SOAP actor roles associated with an execution of the handler chain. Note that SOAP actor roles apply to the SOAP node and are managed using [SOAPBinding.setRoles(java.util.Set<java.lang.String>)](../../../../../javax/xml/ws/soap/SOAPBinding.html#setRoles-java.util.Set-) and[SOAPBinding.getRoles()](../../../../../javax/xml/ws/soap/SOAPBinding.html#getRoles--). `Handler` instances in the handler chain use this information about the SOAP actor roles to process the SOAP header blocks. Note that the SOAP actor roles are invariant during the processing of SOAP message through the handler chain. Returns: Array of `String` for SOAP actor roles
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.