簡體   English   中英

JAX-WS未列出WAS 8.5.5下的服務

[英]JAX-WS not listing the services under WAS 8.5.5

我按照本指南在WAS上啟用了第三方JAX-WS: 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

這是我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 /太陽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>

注釋已正確禁用,並且wsgen會生成工件和WEB-INF / wsdl文件夾。

我還創建了以下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> 

相同的配置在tomcat和weblogic下均可使用,但在8.5.5(使用后置父策略)下,不會公開任何服務。 WebSphere控制台顯示“沒有錯誤”:

[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

禁用WAS JAX-WS引擎后,WAS將不會在已部署的應用程序中檢測和構建Web服務工件。 然后,JAX-WS服務將不會在WAS管理控制台上列出,這是預期的行為。 除未列出服務外,是否觀察到任何錯誤? 而且我發現Web服務DD文件名不正確,應該是webservices.xml。

問候楊

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM