Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 246
Bluddymarri Avatar asked Nov 13 '22 07:11

Bluddymarri


1 Answers

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>
like image 64
coderplus Avatar answered Nov 15 '22 09:11

coderplus