This discussion is archived
3 Replies Latest reply: May 31, 2012 4:52 PM by vladodias RSS

How to get JAX-WS server to generate SSL endpoint URLs?

361137 Newbie
Currently Being Moderated
Working on a project which requires web services in an SSL environment.

But the soap:address location attribute it creates is for http, not https. How do I configure jax-ws so that the wsdl it generates has the correct https urls? I do not explicitly set any urls in my web service annotations and was hoping I wouldn't need to, I let JAX-WS handle it automatically.
  • 1. Re: How to get JAX-WS server to generate SSL endpoint URLs?
    vladodias Guru
    Currently Being Moderated
    This may help:

    How to disable http for JAX-WS

    Edited by: EJP on 3/06/2012 16:55
  • 2. Re: How to get JAX-WS server to generate SSL endpoint URLs?
    361137 Newbie
    Currently Being Moderated
    Hello, thanks for the reply.

    Unfortunately I couldn't find any solution to my problem in that thread.

    I do have in my web.xml the security-constraint set to all URLs (/*) and the transport-guarantee set to CONFIDENTIAL.

    When JAX-WS produces the WSDLs for my web services, it puts the soap address location as http instead of https.

    When I manually modify the WSDL with the SSL URL everything works fine. Otherwise when soapUI takes the WSDL generated by JAX-WS it fails.

    Is this perhaps a WebLogic server configuration thing?

    So my web-xml looks like:

    <security-constraint>
    <web-resource-collection>
    <web-resource-name>All_URL</web-resource-name>
    <url-pattern>/*</url-pattern>
    <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
    <role-name>******</role-name>
    </auth-constraint>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>

    I use a sun-jaxws.xml file to configure my web service end points, like this for example:

    <endpoint
    name="TestService"
    implementation="com.test.TestWebServiceImpl"
    url-pattern="/test"
    />

    In the web service class itself I just use @WebService and @WebResult tags - no attributes at all

    and then the WSDL that gets generated has:
    - <service name="TestWebServiceImpl">
    - <port name="TestWebServiceImplPort" binding="tns:TestWebServiceImplPortBinding">
    <soap:address location="http://something.com:80/test" />
    </port>
    </service>

    It even puts that :80 in there for some reason....

    Edited by: trant on May 31, 2012 8:35 AM
  • 3. Re: How to get JAX-WS server to generate SSL endpoint URLs?
    vladodias Guru
    Currently Being Moderated
    Hi Trant,

    Very interesting issue, I found that this annotation may do the magic...

    @Policy(uri="policy:Wssp1.2-2007-Https-BasicAuth.xml")

    Some pointers:

    http://docs.oracle.com/cd/E17904_01/web.1111/e13713/transport.htm#WSSOV241

    http://docs.oracle.com/cd/E23943_01/web.1111/e13713/message.htm

    https://kr.forums.oracle.com/forums/thread.jspa?threadID=1019313

    Hope that helps.

    Cheers,
    Vlad

    Remember to give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points