4 Replies Latest reply: Dec 3, 2012 9:22 AM by 974253 RSS

    Unable to change contextPath using WLHttpTransport

    974253
      Hi,


      I am not able to change the contextPath using WLHttpTransport ant task in Weblogic 10.3.5. It always takes the default contextPath. This is the snippet from the build.xml file.

      <target name="create-war">
                <jwsc
           srcdir="src"
           destdir="dist"
           debug="true"
           classpathref="classpath">
           <module name="MyService">
                <jws file="com/lp/MyService.java" type="JAXWS" generateDescriptors="true">
                               <WLHttpTransport contextPath="TestService" serviceUri="V4" >
                               </WLHttpTransport>
                          </jws>
                     </module>
      </jwsc>
      </target>

      Though I specified the contextPath as "TestService", the contextPath is always set as "MyService". Please let me know if I need to do anything else to make this work.

      Thanks.
        • 1. Re: Unable to change contextPath using WLHttpTransport
          Vijaya Moderator -Oracle
          Hi,

          WLHTTPTRANSPORT is not a recommended annotation in JAX-WS.

          You may end up with the error like below, if you use WLHttpTransport

          [jwsc] [ERROR] - The annotation weblogic.jws.WLHttpTransport is not allowed
          on com.oracle.hello.jaxws.HelloWorld because it is a JAX-WS type web service.

          JAXWS does not support WLHttpTransport annotation which is WLS specific, so most likely it is getting ignored.

          Thanks,
          Vijaya
          • 2. Re: Unable to change contextPath using WLHttpTransport
            974253
            Hi Vijaya,

            Thanks for your response.

            Since WLHttpTransport annotation is not supported in JAX-WS, I tried to use the element <WLHttpTransport> as suggested in the following link:

            http://docs.oracle.com/cd/E13222_01/wls/docs100/webserv_ref/anttasks.html#wp1051374

            But I found that if I set the context path in weblogic.xml and include it in the descriptor element as given below, then it worked.

            <target name="create-war">
            <jwsc
            srcdir="src"
            destdir="dist"
            debug="true"
            classpathref="classpath">
            <module name="MyService">
            <jws file="com/lp/MyService.java" type="JAXWS" generateDescriptors="true">
            <WLHttpTransport contextPath="TestService" serviceUri="V4" >
            </WLHttpTransport>
            </jws>
            <descriptor file="WebContent/WEB-INF/web.xml" />
            <descriptor file="WebContent/WEB-INF/weblogic.xml" />
            </module>
            </jwsc>
            </target>

            But I just want to know why my settings in WLHttpTransport is ignored, am I missing anything ?

            Thanks.
            • 3. Re: Unable to change contextPath using WLHttpTransport
              User696-Oracle
              But I just want to know why my settings in WLHttpTransport is ignored, am I missing anything ?
              <WLHttpTransport contextPath="TestService" serviceUri="V4" >
              </WLHttpTransport>

              You should be getting a warring message as follows ...
              [jwsc] [WARNING] - The context path TestService specified on port of web service {http://jaxws.hello.oracle.com/}HelloWorldService is being overriden with jaxws.

              behavior is Works as Designed. In future adding an annotation-based mechanism for setting the contextpath to JAX-WS.

              If you want to add context root you would try using module.

              <jwsc
              srcdir="output\src" destdir="module\helloWorldEar">
              <module contextPath="jaxwsejb" name="sampleAPP" >
              <jws file="com\bea\ServiceBean.java"
              type="JAXWS" >
              </jws>
              </module>
              </jwsc>

              Regards,
              Sunil P
              • 4. Re: Unable to change contextPath using WLHttpTransport
                974253
                Hi Sunil,

                Thanks for the response. I will check this out as I was working on another task and could not get a chance to check this out.

                Regards,
                daves09