更改soap:地址位置从http到https

时间:2012-04-08 13:49:58

标签: java web-services soap axis2

是的,我的应用服务器在https上运行。客户端要求将soap地址从http更改为https。

客户要求每当他想要2看到wsdl通过broswer肥皂地址应该来自https

我已经在axis2.xml中添加了这个...

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

我在service.xml中添加了以下内容

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

关闭标签后,但它会给我以下错误。

它给了我异常

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 – 

3 个答案:

答案 0 :(得分:0)

这就是我所做的:

创建证书

keytool -genkey -alias localhost -keypass password -keystore /choose/a/path/localhost.bin -storepass password -keyalg RSA

在tomcat中为AXIS2在服务器端启用SSL

在tomcat的Server.xml中添加以下内容:

<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"/>

更改axis2.xml

(您可以同时使用:http和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>

希望它有所帮助。

答案 1 :(得分:0)

service.xml 中存在拼写错误。它应该是:

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

不是HTTPS。

您的 wsdl 将如下所示:

 <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>

还有一点,请确保添加了 http-core jar。

答案 2 :(得分:0)

在standalone.xml中,我做了这些更改:             

    <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"/>