简体   繁体   中英

Creating a Springboot Web Service SOAP client

I am creating a simple Springboot application (1.5.2) with a dependency on springboot-starter-web-services .

I have the WSDL for the service I need to consume and have generated all of the classes by using wsimport. One thing I noticed was the generated classes includes an interface with all of the remote methods & their annotations.

My question, should I be using this interface? If so, how do I configure spring to use it?

I followed the Springboot tutorial found here but do not see this generated interface class mentioned anywhere. I attempted to call the webservice just like the tutorial says, but I am getting an error such as "The endpoint reference (EPR) for the operation not found is " http://mydefaulturi.com " and the WSA action ="

The generated interface has all of the methods the webservice supports as well as some annotations such as @WebMethod , @WebResult , @RequestWrapper & @ResponseWrapper . I suspect these annotations are required at the client end when making the request, but I am not using this interface.

I followed the Springboot tutorial found here but do not see this generated interface class mentioned anywhere.

Below line in Springboot tutorial found here , uses WSDL generated classes (GetQuote and GetQuoteResponse).

In this method, both the GetQuote and the GetQuoteResponse classes are derived from the WSDL and were generated in the JAXB generation process described in the previous step. 

Should I be using this interface?

I think yes. In the example, the classes will be generated under hello.wsdl package, mentioned under Generate domain objects based on a WSDL section. It uses jaxb2 plugin and you are using wsimport . Both should work properly.

Hope this helps you.

(It will be helpful if you can provide some client and configuration classes similar to your implementation)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM