4

我是 SOAP 新手,正在构建我的第一个 Axis2 (v 1.6.2) Web 服务。我从一位同事那里复制了一个小型测试服务,如果我使用 http 而不是 https,它就会运行。我的同事没有这个问题。

我收到的错误是“javax.servlet.ServletException:https 被禁止”。我的 Axis2.xml 文件包含以下内容:

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

我正在测试 localhost、JRE 6.1 和 Tomcat 7.0.25。我的同事(能够使用 https)正在使用 Websphere 6 和 Axis2 v.1.6.0,因此这可能是 appserver 或 Axis2 版本问题。我们不使用 Maven。

我的 Tomcat 端口是 http:8080、https:8443 和 AJP:8009。

任何解决此 https 错误的帮助将不胜感激。

更新:尚无解决方案,但似乎与以下内容相似或相同: https ://stackoverflow.com/questions/13808029/http-is-forbidden-exception-while-accessing-the-axis-2-webservice

4

2 回答 2

1

I discovered the cause. I have the following entry in my web.xml file, for the AxisServlet servlet. My co-worker also had the entry, but hers was commented out. This entry caused a "file not found" error on server startup. Commenting this out resolved the issue.

    <init-param>
        <param-name>axis2.xml.path</param-name>
        <param-value>/WEB-INF/conf/axis2.xml</param-value>
    </init-param>

linuxlewis, thank you for your response!

于 2012-12-13T19:40:18.447 回答
0

我可以想到两个可能的问题。

  1. 可能位于 Web 服务前面的 IIS/Apache 服务器正在使用某种域限制。使用 mod_authz_host,您可以根据域限制对特定 http 模式的访问

  2. 如果您使用 Java 从服务器访问 Web 服务,那么您可能需要在 JDK 安全 cacerts 文件中安装与 Web 服务关联的证书。如果您的同事在 websphere 中工作,他们可能已经安装了证书

于 2012-12-13T17:50:04.103 回答