有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java JAXRPC Web服务自动重定向到https

我已经使用JAX-RPC创建了一个Web服务。当调用webservice时,会发生LDAP身份验证,该身份验证将由WebSphere容器处理,然后会重定向回实际的webserivce

但是当我看到日志时,它显示了一个302错误,url被改为https而不是http

请在这方面帮助我

网站上的条目。xml如下所示:

<web-resource-collection>
    <web-resource-name>MyService</web-resource-name>
    <description></description>
    <url-pattern>/services/*</url-pattern>          
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    <http-method>HEAD</http-method>
</web-resource-collection>
<auth-constraint>
    <description>Used by Medescription>
    <role-name>BasicUserRole</role-name>
</auth-constraint>

共 (1) 个答案

  1. # 1 楼答案

    如果您的应用程序受到保护,它可能会基于user-data-constraint重定向到https。如果不想将settransport-guarantee重定向到NONE

    ...  
      <user-data-constraint>
         <transport-guarantee>NONE</transport-guarantee>
      </user-data-constraint>
    </security-constraint>