Ok, I don't have any real experience in this specific to JAX-WS, but here is how I interpret the documentation:
The documentation for javax.xml.ws.Provider says: "
Service endpoints may implement the Provider interface as a dynamic alternative to an SEI". In other words, even though the Provider<Source> is receiving raw XML, I think that it will still be dealing with a SOAP message in order to qualify as a "service endpoint". Otherwise, it is not JAX-WS compliant and will be rejected by the web service implementation at runtime.
Also, if you look at Section 5.1 of the JAX-WS 2.0 spec, there are specific requirements for it to qualify as
a JAX-WS service endpoint. The requirements are in Section 3.4: it
MUST have the @WebService annotation. So my guess is that when we use ServiceMode=Service.Mode.PAYLOAD, the WS provider (I mean like Axis, etc.) will return us getSOAPBody(). And if we use Service.Mode.MESSAGE, we will be passed the result of getEnvelope(). So that is what it sounds like to me. I don't think there is getting around the SOAP part. It can't just be any XML.
From the same JAX-WS spec: "
Provider is a low level generic API that requires services to work with messages or message payloads and hence
requires an intimate knowledge of the desired message or payload structure."
So for example, instead of having the easy-to-develop sayHello() programming model (which is sufficient for most purposes)with static, generated code and stubs, if you wanted to parse the individual XML tags/tokens yourself, or if you wanted a very small part of a large XML, and you know exactly how to navigate to the portion of interest to you, then you may consider the whole API (DOM or whatever) as too much of a performance and memory overhead. You might then find this kind of interface useful, and your code might search the XML
string for <myTag> and </myTag) and capture the contents. Just some thoughts. I have come across this situation several times where memory/performance problems dictate a different approach. Hope that explains a little, and hope my interpretation of the specs is accurate.
