jax-ws 学习笔记

A Provider-based endpoint can receive data in javax.xml.transform.Sourcejavax.activation.DataSource or javax.xml.soap.SOAPMessage formats. It can work in either payload or message mode. JAX-WS specification has a conformance requirement (Provider support required) that defines the combinations of the Provider type, the mode and SOAP/HTTP or XML/HTTP binding. Additionally, the message on the service endpoint may be received as SOAP message (does not matter 1.1 or 1.2) or a mime multipart message. The table below summarizes the requirement with all the possible combinations.

  XML/HTTP SOAP/HTTP

Provider<Source>

Payload Primary part or content as Source SOAP Body from the primary part or SOAP Body as Source
Message Primary part or content as Source SOAP Envelope from the primary part or SOAP Envelope as Source

Provider<DataSource>

Payload Not Valid [1] Not Valid [1]
Message DataSource as an object Not Valid [2]

Provider<SOAPMessage>

Payload Not Valid [3] Not Valid [3]
Message Not Valid [4] SOAPMessage as an object

Provider<Source> may receive a mime multipart message or an XML message. If it is a mime multipart message, then the primary part for XML/HTTP and SOAP Envelope for SOAP/HTTP is extracted and converted to the Source for payload mode. The primary part, in the case of mime multipart message, must contain XML data for XML/HTTP binding. If it is an XML message then the content for XML/HTTP (irrespective of mode) is converted to the Source. The XML message is converted to SOAP message and SOAP Body or Envelope for SOAP/HTTP (depending upon the mode) is converted to the Source.

[1] Provider<DataSource> is used for sending attachments and thus payload mode is not valid.

[2] Provider<DataSource> in SOAP/HTTP is not valid since attachments in SOAP are sent using Provider<SOAPMessage>.

[3] Provider<SOAPMessage> in payload mode is not valid because the entire SOAPMessage is received, not just the payload which corresponds to the body of the SOAPMessage.

[4] Provider<SOAPMessage> in message mode using XML/HTTP binding is not valid since the client may have sent an XML message that may not be SOAP.

Provider<Source>-based endpoints using XML/HTTP binding allows you to develop and deploy RESTful Web services with JAX-WS 2.0. 

你可能感兴趣的:(xml,Web,SOAP)