Search code examples
javaweb-serviceswebspherejax-rpc

JAX-RPC webservice redirecting to https automatically


I have created a webservice using JAX-RPC. When the webservice is invoked, an LDAP authentication occurs which will be handled by WebSphere container and then it will be redirected back to the actual webserivce.

But when I see the logs, it shows a 302 error and the url is changed to https instead of http.

Please help me out in this regard.

The entry in the web.xml looks like this:

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

Solution

  • If your application is protected it might get redirected to https based on user-data-constraint. If you don't want to redirect set transport-guarantee to NONE.

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