7 Replies Latest reply on Jul 24, 2009 6:24 AM by Richard Opalka

    javax.xml.ws.WebServiceException: WSDL metadata is missing i

    sumanta laha Newbie

      I'm using JBoss-4.2.2GA with jbossws-native-3.1.2.GA.
      i deployed stateful webservice without any error.
      But calling this Webservice I get this exception in client:

      Exception in thread "main" javax.xml.ws.WebServiceException: WSDL metadata is missing in EPR
       at com.sun.xml.ws.spi.ProviderImpl.getPort(ProviderImpl.java:147)
       at javax.xml.ws.EndpointReference.getPort(Unknown Source)
       at stateful.client.BookService.getPort(BookService.java:48)
       at stateful.client.Main.main(Main.java:33)


      my client code is :

      BookService class:

      @WebServiceClient(name = "BookService", targetNamespace = "http://server.stateful/", wsdlLocation = "http://localhost:8080/StatefulWS/book?wsdl")
      public class BookService extends Service {
      
       private final static URL SERVICE_WSDL_LOCATION;
       static {
       URL url = null;
       try {
       url = new URL("http://localhost:8080/StatefulWS/book?wsdl");
       } catch (MalformedURLException e) {
       e.printStackTrace();
       }
       SERVICE_WSDL_LOCATION = url;
       }
      
       public BookService(URL wsdlDocumentLocation, QName serviceName) {
       super(wsdlDocumentLocation, serviceName);
      
       }
      
       public BookService() {
       super(SERVICE_WSDL_LOCATION, new QName("http://server.stateful/",
       "BookService"));
       }
      
       @WebEndpoint(name = "BookService")
       public BookRemote getPort() {
       return (BookRemote) super.getPort(new QName("http://server.stateful/", "BookPort"), BookRemote.class);
       }
      
       @WebEndpoint(name = "BookService")
       public BookRemote getPort(EndpointReference ref, Class<BookRemote> cl) {
      
      
       return ref.getPort(cl);
       }
      
      
      }





      main class::::

      BookStoreRemote bookstore = new BookStoreService().getBookStorePort();
       BookService service = new BookService();
      
      
       BookRemote book1 = service.getPort(bookstore.getProduct("abc001"),BookRemote.class);
      



        • 1. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
          Richard Opalka Master

          Hi,

          I see two issues here. First JBossWS-Native-3.1.2 is supported on AS 5.x series and above only.
          The second issue I see is you're using wrong classpath. I see sun libraries in the stack trace.
          Please ensure you're using AS 5.x version and correct JBossWS-Native classpath in your IDE.

          • 2. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
            ashutosh deora Newbie

            i am also facing the same problem as mentioned above
            i am using AS 5.x
            but still i am getting this error

            my requirement is a bit different
            i have to use AS 4.2.3
            so what JBossWS-Native version i should use for this
            and second thing is
            my web service should be STATEFUL
            i cannot use stateless WEBSERVICE

            and the change of class path which you have mentioned in the post
            which is releated to the getPort()

            which path i have to change

            i need to use the EndpointReference
            the jar having this is rt.jar (this is in the java jre )

            the another is in JBOSSRUNTIME LIB named as jaxws-rt.jar
            which one i have to remove or modify please tell





            • 3. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
              ashutosh deora Newbie

              i am posting the web.xml here
              please tell what to change in this


              <?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"
               xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
               version="2.4">
               <display-name>TestStateFulWSMetro</display-name>
              
               <listener>
               <listener-class>
               com.sun.xml.ws.transport.http.servlet.WSServletContextListener
               </listener-class>
               </listener>
              
               <servlet>
               <!--description>JAX-WS endpoint</description-->
               <!--display-name>JAX-WS servlet</display-name-->
               <servlet-name>jaxWsServlet</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>jaxWsServlet</servlet-name>
               <url-pattern>/book</url-pattern>
               </servlet-mapping>
               <servlet-mapping>
               <servlet-name>jaxWsServlet</servlet-name>
               <url-pattern>/bookstore</url-pattern>
               </servlet-mapping>
              
              
              
               <session-config>
               <session-timeout>60</session-timeout>
               </session-config>
               <welcome-file-list>
               <welcome-file>index.html</welcome-file>
               <welcome-file>index.htm</welcome-file>
               <welcome-file>index.jsp</welcome-file>
               <welcome-file>default.html</welcome-file>
               <welcome-file>default.htm</welcome-file>
               <welcome-file>default.jsp</welcome-file>
               </welcome-file-list>
              </web-app>


              • 4. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
                Richard Opalka Master

                 

                "ashutoshdeora" wrote:

                i have to use AS 4.2.3
                so what JBossWS-Native version i should use for this
                See this matrix.
                "ashutoshdeora" wrote:

                my web service should be STATEFUL
                i cannot use stateless WEBSERVICE

                The JBossWS webservices have been always stateful.
                But there was a bug with instance reuse, see JBWS-2486.
                Luckily this issue have been fixed in JBossWS Native 3.1.1, so you're ready
                to go with JBossWS-Native-3.1.1.GA on JBossAS-4.2.3 ;)
                "ashutoshdeora" wrote:

                i need to use the EndpointReference
                the jar having this is rt.jar (this is in the java jre )

                the another is in JBOSSRUNTIME LIB named as jaxws-rt.jar
                which one i have to remove or modify please tell

                I'm getting really confused :( So you're using JBossWS Native or JBossWS Metro?
                This is JBossWS-Native forum, for JBossWS-Metro specific user questions please use this forum.


                • 5. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
                  Richard Opalka Master

                   

                  "ashutoshdeora" wrote:
                  i am posting the web.xml here
                  please tell what to change in this

                  See our samples in JBossWS-Native distribution. We're shipping both binary and source distributions with samples (including their sources).

                  • 6. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
                    ashutosh deora Newbie


                    sorry there is no Metro any where in this project
                    if you have told it by name
                    then its my mistake i am very sorry for that
                    i am using JBoss Native WS
                    i will follow your suggestion
                    i want to know about the class path which u have mentioned in your 1st reply

                    please tel about that





                    <?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"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                     version="2.4">
                     <display-name>TestStateFulWS</display-name>
                    
                     <listener>
                     <listener-class>
                     com.sun.xml.ws.transport.http.servlet.WSServletContextListener
                     </listener-class>
                     </listener>
                    
                     <servlet>
                     <!--description>JAX-WS endpoint</description-->
                     <!--display-name>JAX-WS servlet</display-name-->
                     <servlet-name>jaxWsServlet</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>jaxWsServlet</servlet-name>
                     <url-pattern>/book</url-pattern>
                     </servlet-mapping>
                     <servlet-mapping>
                     <servlet-name>jaxWsServlet</servlet-name>
                     <url-pattern>/bookstore</url-pattern>
                     </servlet-mapping>
                    
                    
                    
                     <session-config>
                     <session-timeout>60</session-timeout>
                     </session-config>
                     <welcome-file-list>
                     <welcome-file>index.html</welcome-file>
                     <welcome-file>index.htm</welcome-file>
                     <welcome-file>index.jsp</welcome-file>
                     <welcome-file>default.html</welcome-file>
                     <welcome-file>default.htm</welcome-file>
                     <welcome-file>default.jsp</welcome-file>
                     </welcome-file-list>
                    </web-app>


                    • 7. Re: javax.xml.ws.WebServiceException: WSDL metadata is missi
                      Richard Opalka Master

                       

                      "ashutoshdeora" wrote:

                      i want to know about the class path which u have mentioned in your 1st reply

                      You have to reference jbossws jars in your client classpath only.
                      You also need to set -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed in your client classpath (IDE or shell script)