2
votes

I followed this guide to enable third-party JAX-WS on WAS: http://www.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/twbs_thirdparty.html?cp=SSAW57_8.0.0%2F3-3-0-25-10-1

and this is part of my pom:

    ...
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.2.1</version>
    </dependency>
    ...
    <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>              
         <configuration>
            <archive>
               <manifestEntries>
                  <DisableIBMJAXWSEngine>true</DisableIBMJAXWSEngine>
               </manifestEntries>
            </archive>
         </configuration>               
   </plugin>
   <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>jaxws-maven-plugin</artifactId>
         <version>1.10</version>
         <executions>
             <execution>
             <phase>process-classes</phase>
             <goals>
                 <goal>wsgen</goal>
              </goals>
              </execution>
         </executions>
         <configuration>
              <sei>com.example.myService</sei>
              <genWsdl>true</genWsdl>
              <keep>true</keep>
              <resourceDestDir>${basedir}/src/main/webapp/WEB-INF/wsdl</resourceDestDir>
              <sourceDestDir>${basedir}/src/main/java</sourceDestDir>
         </configuration>
   </plugin>

myService.java:

@WebService(
        targetNamespace = "...", 
        name = "...", 
        serviceName = "...")
public class MyService { 
   @WebMethod
    public String req1() {
       return "";
    }   
}

WEB-INF/web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
   <display-name>Archetype Created Web Application</display-name>
    <listener>
         <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>

   <servlet>
          <servlet-name>...</servlet-name> 
          <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet-mapping>
          <servlet-name>...</servlet-name>
          <url-pattern>/...</url-pattern>
   </servlet-mapping>

WEB-INF/sun-jaxws.xml

<?xml version='1.0' encoding='UTF-8'?>
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'>
    <endpoint name='...' implementation='com.example.myService' url-pattern='/...' ></endpoint>
</endpoints>

The annotation are correctly disabled and the wsgen generate the artifacts and the WEB-INF/wsdl folder.

I've also created this WEB_INF/webservices.xml:

<webservices>
    <webservice-description>
        <webservice-description-name>...</webservice-description-name>
        <wsdl-file>WEB-INF/wsdl/....wsdl</wsdl-file>
         <port-component>
            <port-component-name>...</port-component-name>
            <service-endpoint-interface>com.example.myService</service-endpoint-interface>
            <service-impl-bean>
                <servlet-link>...</servlet-link> 
            </service-impl-bean>
        </port-component>
    </webservice-description>
</webservices> 

This same configuration works under tomcat and weblogic but under was 8.5.5 (with parent last policy) no services are exposed. WebSphere console shows 'no error':

[21/03/16 12.08.37:379 CET] 00000096 http          I   WSSERVLET12: JAX-WS context listener initializing
[21/03/16 12.08.39:371 CET] 00000096 monitoring    I   Metro monitoring rootname successfully set to: null
[21/03/16 12.08.39:602 CET] 00000096 http          I   WSSERVLET14: JAX-WS servlet initializing
1

1 Answers

0
votes

After WAS JAX-WS engine is disabled, WAS won't detect and build the web service artifacts in the deployed application. Then the JAX-WS services won't be listed on WAS admin console, this is expected behavior. Except the services are not listed, is there any error observed? And I found the web service DD file name is not correct, it should be webservices.xml.

Regards Yang