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

安稳与你 提交于 2019-12-04 03:58:57

问题


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.


回答1:


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.




回答2:


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.


来源:https://stackoverflow.com/questions/21090111/how-can-i-generate-a-wsdl-file-from-a-wsdl-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!