tags:

views:

2408

answers:

2

Using the default parameters, the axis 2 wsdl2java tool takes as input a wsdl file and generates a client side Java code that communicates with the SOAP endpoint using the HTTP protocol, like in the example below:

wsdl2java -uri MyService.wsdl

What I would like to know is if there is an input parameter that can be passed to wsdl2java tool to generate client side code that communicates via HTTPS with the SOAP endpoint.

+1  A: 

The following post has your answer, I will not plagiarize and copy it. You can pull that arguments out of the ant xml provided. You need to worry about Java having the certificates it needs. I believe the post is speaking to the client-side code. The https url may also just need to be specified in the WSDL as https.

http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499

Ted Johnson
+1  A: 

We use Axis over HTTPS pretty regularly. As Ted mentioned, getting the SSL certificates in order (esp if self-signed) is very important, as it is effectively a deal-breaker.

Code wise, we usually generate our Axis stubs against a plain HTTP service. The call to the ServiceLocator subclass generated by the wsdl2java command will have a "getMyService" method that takes a URL as a parameter in addition to one that takes no parameters. Depending on the exact Axis version and name of your service, the class names may be a little different. But for the most part the following example demonstrates how easy it is to change the URL (HTTPS or HTTP) to point wherever you want upon instantiation of your stub objects.

MyServiceServiceLocator locator = new MyServiceServiceLocator();
MyService_PortType myservice = locator.getMyService(new URL("https://www.myservice.net/MyService.jws"));

Hope that helps.

monceaux