I am attempting to call a webservice (developed in C#) using JAX-WS, over https. I have tried setting up an invocation through SoapUI, and this works.
But, when trying to do the same through a generated jax-ws client, all I get is a 301 response back. This is similar to what I get using SoapUI with a http url to the same service, and also wireshark tells me that I do a HTTP (HTTP/XML) POST operation. This leads me to belive that for some reason, my generated JAX-WS client attempts to invoke over http, instead of https.
Examplified code:
new MyServiceInterface(new URL("https://acme.com/services/MyService.svc?wsdl"))
.getMyPort().test();
As you can see, I supply a https
url when creating my client. Is there anything else needed in order to make sure that JAX-WS uses https? The namespace URIs are all http, could this cause problems?
Update:
I have implemented a SOAP-request for the service in quesiton using the guide from the accepted answer here: Working Soap client example Pretty much repeated the information from SoapUI, and now it gives me the a proper 200 response.
Update 2:
When debugging my JAX-WS-client, I find this property:
"javax.xml.ws.service.endpoint.address" -> "http://acme.com/services/MyService.svc"
This has http, not https. Relevant?
Update 3:
When using the debugger to change "javax.xml.ws.service.endpoint.address" to the https url, rather than http, my client works. But why is it http to begin with?