问题
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 –
回答1:
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.
回答2:
This is what I did:
Create a certificate
keytool -genkey -alias localhost -keypass password -keystore /choose/a/path/localhost.bin -storepass password -keyalg RSA
Enabling SSL on server side for AXIS2 in tomcat
Add the following in Server.xml
of tomcat:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/choose/a/path/localhost.bin"
keystorePass="password" keyAlias="localhost"/>
Change axis2.xml
(You can use both: http and https)
<transportReceiver name="http"
class="org.apache.axis2.transport.http.AxisServletListener">
<parameter name="port">8080</parameter>
</transportReceiver>
<transportReceiver name="https"
class="org.apache.axis2.transport.http.AxisServletListener">
<parameter name="port">8443</parameter>
</transportReceiver>
Hope it helps.
回答3:
In the standalone.xml i did those changes:
<subsystem xmlns="urn:jboss:domain:webservices:1.2">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>jbossws.undefined.host</wsdl-host>
<wsdl-port>443</wsdl-port>
<endpoint-config name="Standard-Endpoint-Config"/>
来源:https://stackoverflow.com/questions/10063300/change-soapaddress-location-from-http-to-https