9 Replies Latest reply on Aug 14, 2008 3:17 PM by Ritesh Patel

    Error in generating WSDL

    R B Newbie

      Hi All,

      I am trying to create a web service using a simple POJO. I have written the code for the Java class and made changes to the web.xml. I deployed the project as a war file. When I access the URL http://localhost:8080/jbossws/services, I can see the web service deployed. However when I click on the link for the web service, I cannot see the WSDL. I get an error message which says XML Parsing Error: no element found.

      Is there any other configuration change required?

      I am using Jboss 4.2.2.GA.

      Please help!

      Thanks in advance.

        • 1. Re: Error in generating WSDL
          Peter Johnson Master

          Please post the source code for your web service.

          • 2. Re: Error in generating WSDL
            R B Newbie

            Thanks for the reply. The following is the code for the POJO:

            
            package test.services;
            
            import javax.jws.WebMethod;
            import javax.jws.WebParam;
            import javax.jws.WebService;
            import javax.jws.soap.SOAPBinding;
            
            @WebService
            public class HelloService
            {
             @WebMethod
             public String sayHello() {
            
             return "Hello";
             }
            }
            


            The following is the web.xml change:

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
             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">
            
             <servlet>
             <servlet-name>HelloService</servlet-name>
             <servlet-class>test.services.HelloService</servlet-class>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>HelloService</servlet-name>
             <url-pattern>/*</url-pattern>
             </servlet-mapping>
            </web-app>
            


            When i deployed the war file, i noticed the following exception thrown at the Jboss server console:
            java.lang.IllegalStateException: Cannot find endpoint meta data for: HelloService
            


            Any idea what could be the issue?

            • 3. Re: Error in generating WSDL
              Peter Johnson Master

              Try changing the url-pattern in to web.xml file:

              <url-pattern>/hello</url-pattern>



              • 4. Re: Error in generating WSDL
                R B Newbie

                Thanks for the response again. Well I had tried that.. in fact had tried several combinations of the URL Pattern but its all the same ! I wouldnt have thought that creating a simple web serivce would be so frustrating :-(
                Personally, I dont think there is anything wrong with the code, the code i have written is very basic and as shown on the JBoss site. I am just wondering if its anything to do with the JBoss server configuration itself. Do any JBoss specific files need to be modified?

                • 5. Re: Error in generating WSDL
                  Peter Johnson Master

                  As far as I can tell, your code looks just like mine, and it works for me.

                  What JDK are you using?

                  • 6. Re: Error in generating WSDL
                    R B Newbie

                    I'm using JDK 1.5.0_05

                    Do you mind posting your code so that i can compare it with mine and try to see if im doing something wrong?

                    • 7. Re: Error in generating WSDL
                      Peter Johnson Master

                      I created a new project using the exact code you posted, compiled the web service, packaged it in a war file, deployed it, and it works for me. I am using:

                      09:53:37,163 INFO [ServerInfo] Java version: 1.5.0_14,Sun Microsystems Inc.
                      09:53:37,163 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_14-b03,Sun Microsystems Inc.

                      • 8. Re: Error in generating WSDL
                        R B Newbie

                        I tried deploying the web service as an EJB and that has worked! So i am going to give up deploying as a servlet for now. Will have another go when i find some time. Thanks for all your help anyways!

                        • 9. Re: Error in generating WSDL
                          Ritesh Patel Newbie

                          I'm having the same issue, I've a simple HelloWorld that i'm trying to deploy on JBoss, but keep getting "cannot find endpoint meta data" error. I'm able to deploy it on GlassFish and WebLogic, just JBoss is giving me problems.

                          Here's the thread that i made for this issue
                          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=140865

                          Please help me fix this!