Jax-ws with https url ends up as http
<p>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.</p>

<p>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. </p>

<p>Examplified code:</p>

<pre><code> new MyServiceInterface(new URL("https://acme.com/services/MyService.svc?wsdl"))
                       .getMyPort().test();
</code></pre>

<p>As you can see, I supply a <code>https</code> 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?</p>

<p>Update:</p>

<p>I have implemented a SOAP-request for the service in quesiton using the guide from the accepted answer here: <a href="https://stackoverflow.com/questions/15948927/working-soap-client-example">Working Soap client example</a>
Pretty much repeated the information from SoapUI, and now it gives me the a proper 200 response.</p>

<p>Update 2: </p>

<p>When debugging my JAX-WS-client, I find this property:</p>

<pre><code>"javax.xml.ws.service.endpoint.address" -&gt; "http://acme.com/services/MyService.svc"
</code></pre>

<p>This has http, not https. Relevant?</p>

<p>Update 3:</p>

<p>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?</p>