7 Replies Latest reply on Jul 5, 2007 5:24 AM by Florian Bauer

    HalloWorld Problem

    Florian Bauer Newbie

      I got exceptions by tring a hallo world example
      I use: jboss-4.2.0.GA with jbossws-1.2.1.GA (default WS)

      My EJB- endpoint:

      import javax.ejb.Stateless;
      import javax.jws.WebMethod;
      import javax.jws.WebResult;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      
      //@WebService
      @WebService(name="HalloWorldWS")
      //@WebService(name="HalloWorldWS",serviceName="HalloWorldWSService")
      @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
      //@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
      //@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
      @Stateless
      public class HalloWorldWSImpl implements HalloWorldWS
      {
       @WebMethod(operationName="getHalloWorld")
       @WebResult(name="hallo")
       public final String getHalloWorld()
       {
       return "Hallo Welt";
       }
      
      }
      


      and my client unit test code:
       private void initByService() throws Exception
       {
       String strURL = "http://localhost:8080/HalloWorldWSImplService/HalloWorldWSImpl";
       String strQName = "HalloWorldWSImpl";
       URL url = new URL(strURL + "?wsdl");
       QName qname = new QName(strURL,strQName);
       Service service = Service.create(url, qname ); //here I get the exception!!!
       HalloWorldWS mySessionBean = service.getPort(HalloWorldWS.class);
       }
      


      By using the SOAPBinding:
      @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
      I get the following exception:
      javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
       at javax.xml.ws.Service.create(Service.java:731)
       at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
       at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
       at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
       at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
       at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
       at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
       at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
       at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
       at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
       at javax.xml.namespace.QName.<init>(QName.java:164)
       at javax.xml.namespace.QName.<init>(QName.java:113)
       at com.ibm.wsdl.xml.WSDLReaderImpl.parseExtensibilityAttributes(WSDLReaderImpl.java:1344)
       at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1268)
       at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
       at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
       at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
       at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
       at javax.xml.ws.Service.<init>(Service.java:83)
       at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at javax.xml.ws.Service.create(Service.java:726)
       ... 22 more
      


      By using the SOAPBinding:
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)

      or

      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
      I get the following exception:

      javax.xml.ws.WebServiceException: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
       at javax.xml.ws.Service.create(Service.java:731)
       at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
       at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
       at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
       at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
       at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
       at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
       at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
       at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
       at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
       at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)
       at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
       at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
       at javax.xml.ws.Service.<init>(Service.java:83)
       at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at javax.xml.ws.Service.create(Service.java:726)
       ... 22 more
      Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
       at com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
       at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
       at com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2019)
       at com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1278)
       at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1257)
       at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
       at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
       at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
       ... 33 more
      


      where is my stupide mistake?

      Thank you!

        • 1. Re: HalloWorld Problem
          Davide Ling Newbie

          In test/client code
          when You create QNames
          you have to use the namespace, not the service url.

          QName("http://serviceNameSpace/","ServiceName")
          



          • 2. Re: HalloWorld Problem
            Florian Bauer Newbie

            Thank you, that works now.
            But now I get the following exception for any SOAPBinding:

            javax.xml.ws.WebServiceException: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:string'.
             at javax.xml.ws.Service.create(Service.java:731)
             at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
             at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
             at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
             at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
             at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
             at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
             at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
             at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
             at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
             at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
             at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
             at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
             at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
            Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:string'.
             at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)
             at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
             at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
             at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
             at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
             at javax.xml.ws.Service.<init>(Service.java:83)
             at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
             at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
             at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
             at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
             at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
             at javax.xml.ws.Service.create(Service.java:726)
             ... 22 more
            Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:string'.
             at com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
             at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
             at com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2019)
             at com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1282)
             at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1257)
             at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
             at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
             at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
             at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
             at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
             at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
             at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
             ... 33 more
            
            


            Any idea?

            • 3. Re: HalloWorld Problem
              Davide Ling Newbie

              Can You try tu specify the same targetnamespace
              both in your service interface and your service implementation?

              example:

              1) interface

              @WebService(
               name="TheServicePortType",
               targetNamespace="http://www.tai.it/TheService"
              )
              @SOAPBinding(
               use=SOAPBinding.Use.LITERAL,
               style=SOAPBinding.Style.DOCUMENT,
               parameterStyle=SOAPBinding.ParameterStyle.WRAPPED
              )
              public interface TheService {
              
              // bla bla ....
              
              }
              


              2) Implementation

              @WebService(
               endpointInterface="mypackage.TheService",
               targetNamespace="http://www.tai.it/TheService",
               serviceName="TheService",
               portName="TheServiceSOAP"
              )
              public class TheServiceImpl implements TheService {
              
              //... bla bla implementation
              
              }
              


              Bye

              • 4. Re: HalloWorld Problem
                Davide Ling Newbie

                Another question...
                did you start from WSDL or Java?

                • 5. Re: HalloWorld Problem
                  Florian Bauer Newbie

                  I do not know if I understood your question, but I think I start from WSDL:

                  public class TheServiceImplTest
                  {
                   TheService mySessionBean;
                   @Before
                   public void setUp() throws Exception
                   {
                   String strURL = "http://localhost:8080/TheServiceImplService/TheServiceImpl";
                   String strNameSpace = "http://www.tai.it/TheService";
                   String strQName = "HalloWorldWS";
                   URL url = new URL(strURL + "?wsdl");
                   QName qname = new QName(strNameSpace,strQName);
                   Service service = Service.create(url, qname );
                   TheService mySessionBean = service.getPort(TheService.class);
                   }
                   @Test
                   public final void testGetHalloWorld()
                   {
                   String strTemp = mySessionBean.getHalloWorld();
                   System.out.println(strTemp);
                   }
                  }
                  


                  I implemented the service exactly as you described:

                  The Interface:

                  import javax.ejb.Local;
                  import javax.jws.WebService;
                  import javax.jws.soap.SOAPBinding;
                  @WebService(name="TheServicePortType",targetNamespace="http://www.tai.it/TheService")
                  SOAPBinding.Use.LITERAL)
                  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
                  @Local
                  public interface TheService
                  {
                   public String getHalloWorld();
                  }
                  


                  The Implementation:
                  import javax.ejb.Stateless;
                  import javax.jws.WebService;
                  
                  @WebService(
                   endpointInterface="com.dooris.ws.TheService",
                   targetNamespace="http://www.tai.it/TheService",
                   serviceName="TheService",
                   portName="TheServiceSOAP"
                  )
                  @Stateless
                  public class TheServiceImpl implements TheService
                  {
                   public final String getHalloWorld()
                   {
                   return "Hallo Welt";
                   }
                  }
                  


                  The Exception:
                  javax.xml.ws.WebServiceException: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorldResponse'.
                   at javax.xml.ws.Service.create(Service.java:731)
                   at com.dooris.ws.TheServiceImplTest.initByService(TheServiceImplTest.java:30)
                   at com.dooris.ws.TheServiceImplTest.setUp(TheServiceImplTest.java:18)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:585)
                   at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
                   at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
                   at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
                   at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
                   at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
                   at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
                   at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
                   at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
                   at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                   at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
                   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
                   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
                  Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorldResponse'.
                   at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)
                   at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
                   at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
                   at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
                   at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
                   at javax.xml.ws.Service.<init>(Service.java:83)
                   at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                   at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
                   at javax.xml.ws.Service.create(Service.java:726)
                   ... 22 more
                  Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorldResponse'.
                   at com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
                   at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2019)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1278)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1257)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
                   at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
                   at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
                   ... 33 more
                  


                  The WSDL:

                  <definitions name='TheService' targetNamespace='http://www.tai.it/TheService' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://www.tai.it/TheService' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
                   <types>
                   <xs:schema targetNamespace='http://www.tai.it/TheService' version='1.0' xmlns:tns='http://www.tai.it/TheService' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
                   <xs:element name='getHalloWorld' type='tns:getHalloWorld'/>
                   <xs:element name='getHalloWorldResponse' type='tns:getHalloWorldResponse'/>
                   <xs:complexType name='getHalloWorld'/>
                   <xs:complexType name='getHalloWorldResponse'>
                   <xs:sequence>
                   <xs:element minOccurs='0' name='return' type='xs:string'/>
                  
                   </xs:sequence>
                   </xs:complexType>
                   </xs:schema>
                   </types>
                   <message name='TheServicePortType_getHalloWorldResponse'>
                   <part element='tns:getHalloWorldResponse' name='getHalloWorldResponse'></part>
                   </message>
                   <message name='TheServicePortType_getHalloWorld'>
                   <part element='tns:getHalloWorld' name='getHalloWorld'></part>
                  
                   </message>
                   <portType name='TheServicePortType'>
                   <operation name='getHalloWorld' parameterOrder='getHalloWorld'>
                   <input message='tns:TheServicePortType_getHalloWorld'></input>
                   <output message='tns:TheServicePortType_getHalloWorldResponse'></output>
                   </operation>
                   </portType>
                   <binding name='TheServicePortTypeBinding' type='tns:TheServicePortType'>
                   <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
                  
                   <operation name='getHalloWorld'>
                   <soap:operation soapAction=''/>
                   <input>
                   <soap:body use='literal'/>
                   </input>
                   <output>
                   <soap:body use='literal'/>
                   </output>
                   </operation>
                  
                   </binding>
                   <service name='TheService'>
                   <port binding='tns:TheServicePortTypeBinding' name='TheServiceSOAP'>
                   <soap:address location='http://localhost:8080/TheServiceImplService/TheServiceImpl'/>
                   </port>
                   </service>
                  </definitions>
                  


                  • 6. Re: HalloWorld Problem
                    Davide Ling Newbie

                    If you start from WSDL
                    try to get service artifacts by wsconsume

                    • 7. Re: HalloWorld Problem
                      Florian Bauer Newbie

                      ok - now I understood! I do not start from WSDL. I generate the WSDL by jboss at deployment time.

                      Now I generated my java sources by wsconsume from the (bad generated) WSDL and I got the same Exception, of Corse.

                      What is the way to tell jboos to generate valid WSDL from my java sources?