Search code examples
javasoapspring-wsws-addressing

@PayloadRoot vs @Action vs @SoapAction in Spring-WS


Could someone explain why I would use one of these endpoint annotations over the other in spring-ws? In particular, which one would be considered the most inclusive? Can I use all three? I've read the doc and I know that @Action uses ws-addressing and @SoapAction uses the SOAP Action transport header, but I'm not really sure which of these would be preferable to use.

Thanks.


Solution

  • Depending on your message design you should use the kind of mapping that better fits:

    The most common case is the use of @PayloadRoot. When you follow a document-style web service design, the fully qualified name of a message is enough to determine how it will be processed, and each document requires a different kind of processing.

    In case you have multiple elements that are processed in the same way, you can use the same action (SOAP or WS-addressing) for the and redirect them to the same endpoint.