Search code examples
javaweb-servicessoapapache-axis

change soap:address location from http to https


yes my application server runs on https. Client is asking to change the soap address from http to https.

client is asking that whenever he want 2 see the wsdl through broswer the soap address should come as https

i already added this in axis2.xml...

<transportReceiver name="https"      class="org.apache.axis2.transport.http.SimpleHTTPServer"> <parameter     name="port">8443</parameter> 
</transportReceiver>

I added the below in service.xml

<transports> <transport>HTTPS</transport> </transports> 

after the closed tag, but it give me below error.

it gives me exception

org.apache.axis2.deployment.DeploymentException: Service [ RTAPDevService] is trying to expose in a transport : <transports> <transport>HTTPS</transport> </transports> and which is not available in Axis2 – 

Solution

  • There is a typo in service.xml. It should be :

    <transports><transport>https</transport></transports>
    

    not HTTPS.

    Your wsdl will look like this:

     <wsdl:service name="SampleService">
    <wsdl:port name="SampleServiceHttpsSoap11Endpoint" binding="ns:SampleServiceSoap11Binding">
    <soap:address location="https://localhost:8443/Axis2HttpsProject/services/SampleService.SampleServiceHttpsSoap11Endpoint/"/>
    </wsdl:port>
    <wsdl:port name="SampleServiceHttpsSoap12Endpoint" binding="ns:SampleServiceSoap12Binding">
    <soap12:address location="https://localhost:8443/Axis2HttpsProject/services/SampleService.SampleServiceHttpsSoap12Endpoint/"/>
    </wsdl:port>
    <wsdl:port name="SampleServiceHttpsEndpoint" binding="ns:SampleServiceHttpBinding">
    <http:address location="https://localhost:8443/Axis2HttpsProject/services/SampleService.SampleServiceHttpsEndpoint/"/>
    </wsdl:port>
    </wsdl:service>
    

    And one thing more,make sure you have added http-core jar.