Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a WS-client from WSDL file using Spring-WS? (It seems not)

I'd like to know if it's possible to create Web Services client from a WSDL file using Spring Web Services.

I mean from the very WSDL, I don't have any XSD for the time being.

But I've read Josh Long's "Spring Recipes A Problem-Solution Approach", Hamidreza Sattari's "Spring Web Services 2 Cookbook" and the tutorial itself (6. Using Spring Web Services on the Client) and there's no reference to this feature.

I've also read other posts, like Webservice-Client: Common approach with Spring WS, JAXB and just one WSDL file?, or Spring-ws client from WSDL (here at stackoverflow) but without any further results.

I've even asked the question at Spring forums, but no responses after more than 60 reads: Is it possible to create a WS-client from WSDL file using SWS? (It seems not)

Maybe it's not possible.

Thanks.

like image 874
jbbarquero Avatar asked Dec 10 '12 15:12

jbbarquero


People also ask

How do I create a WSDL from a web service?

Generating a WSDL From a Web Service Class On the Project Explorer or Navigator tab, right-click the web service class and select Web Services > Generate WSDL.

How are WSDL generated?

A Web Services Description Language (WSDL) document specifies the interface to a web service, and enables a web service client to start it. A WSDL document that is generated from a message model defines web service requests and responses in terms of the messages that you have defined in that message model.


1 Answers

You can do it this way:

  1. Generate your java types using the xjc tool that comes with the JDK distributions - xjc -wsdl file.wsdl

  2. Then using the generated java types, use WebserviceTemplate, described here to create the client.

like image 82
Biju Kunjummen Avatar answered Sep 24 '22 16:09

Biju Kunjummen