问题
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