Search code examples
javasoapwsdlrequestbpel

How to make a SOAP Request to an Endpoint or WSDL like SoapUI?


I need to make a request to a BPEL process that's described by a WSDL. I've been using SoapUI to test it by providing the WSDL URL and everything works fine.

Now I need to make the same but in Java. I'm building a webservice that receives data from another webservice and that needs to pass it to the BPEL Process. I've tried to generate stubs with wsdl2java and wsimport, but that doesn't work because my BPEL WSDL doesn't have a service definition (I can't add it, because if I do the WSDL doesn't work in my BPEL).

So, since SoapUI is able to make the request it is obvious that there's some way to make a call to the BPEL WSDL without the service definition in it and I think that's the only solution for my problem.

TL/DR: How does SoapUI make requests to wsdl files and how can I do the same?


Solution

  • I managed to solve this by creating a new WSDL that would create stubs compliant with the ones from the BPEL WSDL and by creating a client class that sends a SOAP message as described in here. To find out what I needed to define in the message I used the SoapUI logger to see what the message was sending.