简体   繁体   中英

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.

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.

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.

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