Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate a WSDL file from a WSDL URL?

My problem is that I created a web service client with wsimport and when creating its service object, it fails because of the HTTPS, like that:

MyService_Service service = new MyService_Service(
                                new URL("https://www.aaa.com/myws/MyService?WSDL"));

So, I am trying to initialize a service object from a WSDL file, but how can I create a WSDL file from that URL "https://www.aaa.com/myws/MyService?WSDL"?

Thanks a lot.

like image 242
emre Avatar asked Jan 13 '14 11:01

emre


People also ask

How is a WSDL file generated?

In the main menu, go to Tools | XML WebServices and WSDL | Generate WSDL From Java Code. In the Generate WSDL From Java dialog that opens, specify the following: The name and URL address of the Web service. The protocol and encoding style used when accessing the public operations of the Web service.


2 Answers

Navigate to the URL in a browser and save the file it generates. You'll need to make sure you also save any schemas imported by the wsdl.

like image 140
M21B8 Avatar answered Oct 17 '22 01:10

M21B8


JAX-WS needs WSDL document every time one initializes service instance. Since issues like one you described might occur, its possible to package WSDL and associated XSD schemas, so that they would be accessible no matter what.
I'd prefer using XML catalogs, since there would be no need to change WSLD document or XSD schema.
Another option would be to specify @WebService wsdlLocation property and set path to WSDL file. Though if path to XSD schemas is absolute you'll have to modify WSLD document.
If you're working with wsimport utility version that supports clientjar option, that might save you some time.

Creates the jar file of the generated artifacts along with the WSDL 
metadata required for invoking the web service.
like image 25
Arunas Junevicius Avatar answered Oct 16 '22 23:10

Arunas Junevicius