Search code examples
maven-2soapwsdlmaven-pluginmojo

Triggering SOAP requests in a Maven Mojo


I have a WSDL which I need to trigger some commands from. I need to do this as part of a Maven Plugin (Mojo)

I'm a relative newbie to SOAP so what I want to know is this:

1) Is this possible? Can the SOAP calls be run from a Maven Plugin or does it require a container or something else?

2) If so, what tools should I use to do this? I've read about Apache Axis and have seen that it's capable of building a lot of things from the WSDL itself. Is this the sort of tool I should use? Do Mojos have a built in SOAP executor?

3) If not, what are my alternatives?


Solution

  • Is this possible? Can the SOAP calls be run from a Maven Plugin or does it require a container or something else?

    Yes, that's possible, you do not require any kind of container to run a SOAP client.

    If so, what tools should I use to do this? I've read about Apache Axis and have seen that it's capable of building a lot of things from the WSDL itself. Is this the sort of tool I should use? Do Mojos have a built in SOAP executor?

    I would consider using a JAX-WS stack like JAX-WS RI which is included in Java 6. Much easier and much more elegant. Here are some tutorials to get started:

    In short, use wsimport to generate and compile the web service artifacts needed to connect to the service and use them from the Mojo.