3 Replies Latest reply: Oct 1, 2012 11:13 AM by user696 RSS

    Isssue in publishingWSDL for @WebServiceProvider

    960466
      I wrote an simple JAX-WS webservice for @WebServiceProvider. After deploying it as war while accessing the WSDL i am facing below error.

      :/GPSProxy spec-version:2.5]] Servlet failed with Exception
      java.lang.NullPointerException
      at weblogic.wsee.jaxws.WLSServletAdapter.publishWSDL(WLSServletAdapter.java:239)
      at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:166)
      at weblogic.wsee.jaxws.HttpServletAdapter.get(HttpServletAdapter.java:193)
      at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:93)
      at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99

      Why is it gives NullPointerException - - Can any one help us ..

      WebService code looks like
      package gpsproxy;
      import java.io.ByteArrayOutputStream;
      import javax.xml.ws.BindingType;
      import javax.xml.ws.ServiceMode;
      import javax.xml.ws.WebServiceProvider;
      import javax.xml.soap.SOAPMessage;
      import javax.xml.ws.Provider;
      @WebServiceProvider(
      portName="GPSProxyPort",
      serviceName="GPSProxyService",
      targetNamespace="http://services.mymclportal.com/SOA/GPSProxyService",
      wsdlLocation="/WEB-INF/wsdl/GPSProxyService.wsdl"
      )
      @BindingType(value="http://schemas.xmlsoap.org/wsdl/soap/http")
      @ServiceMode(value=javax.xml.ws.Service.Mode.MESSAGE)

      public class GPSProxy implements Provider<SOAPMessage> {
      public GPSProxy() { super(); }


      public SOAPMessage invoke(SOAPMessage req){
      System.out.println("Method invoked ");
      System.out.println("invoke: Request: " + getSOAPMessageAsString(req));
      return null;
      }

      private String getSOAPMessageAsString(SOAPMessage msg)
      {
      ByteArrayOutputStream baos = null;
      String s = null;
      try {
      baos = new ByteArrayOutputStream();
      msg.writeTo(baos);
      s = baos.toString();
      } catch(Exception e) {
      e.printStackTrace();
      }
      return s;
      }
      }



      And the web.xml is
      <?xml version = '1.0' encoding = 'windows-1252'?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
           version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
           <filter>
                <filter-name>JpsFilter</filter-name>
                <filter-class>oracle.security.jps.ee.http.JpsFilter</filter-class>
                <init-param>
                     <param-name>enable.anonymous</param-name>
                     <param-value>true</param-value>
                </init-param>
           </filter>
           <filter-mapping>
                <filter-name>JpsFilter</filter-name>
                <url-pattern>/*</url-pattern>
                <dispatcher>FORWARD</dispatcher>
                <dispatcher>REQUEST</dispatcher>
                <dispatcher>INCLUDE</dispatcher>
           </filter-mapping>
           <servlet>
                <servlet-name>GPSProxyPort</servlet-name>
                <servlet-class>gpsproxy.GPSProxy</servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>     
           <servlet-mapping>
                <servlet-name>GPSProxyPort</servlet-name>
                <url-pattern>/GPSProxyPort</url-pattern>
           </servlet-mapping>
           
      </web-app>
        • 1. Re: Isssue in publishingWSDL for @WebServiceProvider
          Kalyan Pasupuleti-Oracle
          Hi,

          your published WSDL file shows that your servlet version as 2.5 try these options.

          1. try to clear cache and tmp folder under server.

          2. or implement the version details with in your app.

          Regards,
          Kal
          • 2. Re: Isssue in publishingWSDL for @WebServiceProvider
            960466
            Hi Kalyan,

            I changed the version to 2.4 also did few changes...

            Now , I am facing some weird issue. Able to see service address http://localhost:7001/GPSProxy-001/GPSProxyService .... But if i open WSDL in browser i get 404 error .... I am not getting any info... no exception in the logs also .....
            WSDL ( http://localhost:7001/GPSProxy-001/GPSProxyService?wsdl)


            I am deploying this in WebLogic 11g . Would there be any reason with @WebServiceProvider to WebLogic 11g. Because this is too simple Webservice . but not working properly.

            Pls . helpe me for this...



            Updated web.xml looks like below.

            <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
            version="2.4">
            <servlet>
            <description>GPSProxy Service</description>
            <display-name>GPSProxy Service</display-name>
            <servlet-name>GPSProxyService</servlet-name>
            <servlet-class>gpsproxy.GPSProxy</servlet-class>
            <load-on-startup>1</load-on-startup>
            </servlet>
            <servlet-mapping>
            <servlet-name>GPSProxyService</servlet-name>
            <url-pattern>/</url-pattern>
            </servlet-mapping>
            </web-app>
            • 3. Re: Isssue in publishingWSDL for @WebServiceProvider
              user696
              please try the patch from bug 13738859 using oracle support if it is not fixed I would open SR with support to further debug the issue.

              Regards,
              Sunil P