简体   繁体   中英

WebService is not “visible” in WebLogic 10.3

I am currently trying to let my application provide a webservice. The application uses spring and is running under a Weblogic 10.3 instance.

I built the webservice following the "contract first" approach. So what I basicaly have is a generated WS-Interface, my implementation of that interface, a web.xml defining the servlet-bindings and a sun-jaxws.xml defining the endpoint. (more or less similar to this: http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/ ).

Now, after deploying my application to weblogic, actualy everything is workign fine. I can type the URL of the WebService into my browser, I see the WSDL, I can call it's methods. If the weren't a small cosmetic fact: In the deployments overview of WL when I click on the deployment, it shows me a list of WebServices...which is empty. So my webservice is NOT listed there.

So, can anyone tell me, what I have to do to get the webservice to show up there?

Though it's not really essential to have a webservice descriptor for JAX-WS, Weblogic at times fails to identify the WebServices(was not able to find a reason for this)

Below is what I did to get it working. Add the WebService implementation class as a Servlet in web.xml

<?xml version='1.0' encoding='UTF-8'?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" id="WebApp_ID">
  <display-name>MyWebService</display-name>
  <servlet>
    <servlet-name>serviceServlet</servlet-name>
    <servlet-class>com.aneesh.WebServiceImpl</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>serviceServlet</servlet-name>
    <url-pattern>/Service</url-pattern>
  </servlet-mapping>
</web-app>

and add the webservice descriptor (webservices.xml)

<?xml version='1.0' encoding='UTF-8'?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1">
  <webservice-description>
    <webservice-description-name>MyWebService</webservice-description-name>
    <port-component>
      <port-component-name>MyWebServiceSoapPort</port-component-name>
      <wsdl-port xmlns:an="http://www.aneesh.com/service">an:MyWebServiceSoapPort</wsdl-port>
      <service-endpoint-interface>com.aneesh.WebService</service-endpoint-interface>
      <service-impl-bean>
        <servlet-link>serviceServlet</servlet-link>
      </service-impl-bean>
    </port-component>
  </webservice-description>
</webservices>

Depending on the developer that created the Web Service, deployment descriptors such as webservices.xml and weblogic-webservices.xml were added to the application. Descriptors are used for configuration, overriding default settings, and adding metadata. For Web Services this can be the endpoint, port configuration, linkage of the Web Service to EJB components, and so on. When deployed, the WSDL location of Web Services is listed in the WebLogic Console and the WSDL can be retrieved at runtime.

From the Trenches 2 | Patching OSB and SOA Suite to PS5

See also:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM