【问题标题】:change soap:address location from http to https将soap:地址位置从http更改为https
【发布时间】:2012-04-21 05:47:18
【问题描述】:

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

客户要求无论何时他想要 2 通过浏览器查看 wsdl,soap 地址应为 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 – 

【问题讨论】:

    标签: java web-services soap axis2


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      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。

      【讨论】:

      • 我还没有测试过..正忙着查看我发布的一个 SSL 问题here..如果您有任何想法,请提供一些指示...无论您提到什么,我都会对其进行测试出去,肯定会发布......
      • 您使用的是哪个axis2版本?我使用了axis2 1.6.1,它成功生成了所需的wsdl。我认为这是以前版本的问题(Axis2-4465),最新版本已解决。
      • 是的,我建议您尝试使用axis2 1.6.1
      • @user1231230 抱歉,但我能够使用axis2 1.6.1成功实现您的目标。
      • 无论如何,恭喜。我猜这对你来说是非常痛苦的。如果有帮助,别忘了接受我的回答。
      【解决方案3】:

      这就是我所做的:

      创建证书

      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>
      

      希望对你有帮助。

      【讨论】:

      • 嗨 enrmarc,我想你误解了我的问题。问题在 wsdl 中的 SOAP 地址中,我希望它从“HTTP”变为“HTTPS”,因为我在 webservice 的 service.xml 中进行了编辑并添加了上述代码,但它仍然不起作用,我得到了上面提到的异常......
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-08
      • 1970-01-01
      • 2020-11-18
      • 2014-10-26
      • 1970-01-01
      相关资源
      最近更新 更多