Objects that implement the Provider
interface have two messaging modes:
The messaging mode you specify determines the level of messaging detail that is passed to your implementation.
When using message mode, a Provider
implementation works
with complete messages. A complete message includes any binding specific headers and wrappers. For example, a
Provider
implementation that uses a SOAP binding receives requests as fully specified SOAP
message. Any response returned from the implementation must be a fully specified SOAP message.
To specify that a Provider
implementation uses message mode by provide the value
java.xml.ws.Service.Mode.MESSAGE
as the value to the
javax.xml.ws.ServiceMode
annotation, as shown in
Example 19.9.
Example 19.9. Specifying that a Provider
Implementation Uses Message Mode
@WebServiceProvider @ServiceMode(value=Service.Mode.MESSAGE) public class stockQuoteProvider implements Provider<SOAPMessage> { ... }
In payload mode a Provider
implementation works with only the payload of a message. For example, a Provider
implementation working in payload mode works only with the body of a SOAP message. The binding layer processes any binding level wrappers and headers.
![]() | Tip |
---|---|
When working with a binding that does not use special wrappers, such as the FUSE Services Framework XML binding, payload mode and message mode provide the same results. |
To specify that a Provider
implementation uses payload mode by provide the value
java.xml.ws.Service.Mode.PAYLOAD
as the value to the
javax.xml.ws.ServiceMode
annotation, as shown in
Example 19.10.
Example 19.10. Specifying that a Provider
Implementation Uses Payload Mode
@WebServiceProvider @ServiceMode(value=Service.Mode.PAYLOAD) public class stockQuoteProvider implements Provider<DOMSource> { ... }
![]() | Tip |
---|---|
If you do not provide a value for the |