1 Reply Latest reply on Sep 4, 2006 8:38 AM by Thomas Diesler

    jboss client newbie question

    Abhi Chat Newbie

      I have just started to use jbossws and webservice in general. I am experiecing some problems. Any help will be appreciated


      Im writing a simple webservice client

      
       public void testWebserviceEntityCilent() throws Exception {
      
       wsdlLocation = new URL(TARGET_ENDPOINT);
      
       serviceName = new QName(TARGET_NAMESPACE, "TestService");
      
      
       File javaWsdlMappingFile = new File("C:/antbuild/CPIWebserviceProduct/client/config/jaxrpc-mapping.xml");
      
       assertTrue(javaWsdlMappingFile.exists());
      
       ServiceFactoryImpl factory = new ServiceFactoryImpl();
      
       ServiceImpl service = (ServiceImpl) factory.createService(wsdlLocation, serviceName, javaWsdlMappingFile.toURL());
      
       call = service.createCall();
      
       QName operation = new QName(TARGET_NAMESPACE, "testEntity");
      
       call.setOperationName(operation);
      
       Employee emp = new Employee("TestEmp", "TestCode");
      
       Plan pl = new Plan("TestPlan", "TestCode");
      
       System.out.println("output:" + call.invoke(new Object[] { emp, pl}));
       }
      
      
      



      But when im runnig the client, im getting an exception


      
      org.jboss.ws.WSException: Cannot obtain client config: Standard Client
       at org.jboss.ws.metadata.ClientEndpointMetaData.getClientConfig(ClientEndpointMetaData.java:107)
       at org.jboss.ws.metadata.ClientEndpointMetaData.getHandlers(ClientEndpointMetaData.java:124)
       at org.jboss.ws.metadata.ClientEndpointMetaData.toString(ClientEndpointMetaData.java:158)
       at java.lang.String.valueOf(Unknown Source)
       at java.lang.StringBuffer.append(Unknown Source)
       at org.jboss.ws.metadata.ServiceMetaData.toString(ServiceMetaData.java:422)
       at java.lang.String.valueOf(Unknown Source)
       at java.lang.StringBuffer.append(Unknown Source)
       at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:127)
       at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:78)
       at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:96)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:142)
       at com.tps.cpi.testClient.TestClient.testWebserviceEntityCilent(TestClient.java:66)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      
      



      Any help will be appreciated. I realized lot of problems happened due to missin jars or imcompatible jars...if this is one of those problems, then any help on required jars will be good

      My 2nd problem

      Im trying to generate jaxrpc-mapping.xml, from a wsdl file to use it for my client, but i get the following error while using wstools

      The conf file is
      
      
      <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
      
       <wsdl-java file="C:/antbuild/wsdl/exchangeconnect.wsdl">
       <mapping file="jaxrpc-mapping.xml" />
       </wsdl-java>
      
      </configuration>
      
      


      
      [javac] Compiling 1 source file to C:\antbuild\CPIWebserviceProduct\classes
       [war] Building war: C:\home\tools\workspace\CPIWebserviceProduct\deploy\test-servlet.war
       [wstools] (xmlschema.JBossXSErrorHandler 73 ) JBossWS_www.plane.biz_exchange_20060125_dependentinfo59731.xsd[domain:http://www.w3.org/TR/1998/REC-xml-19980210]::[key=ElementUnterminated]::Message=Element type "s:enumeration" must be followed by either attribute specifications, ">" or "/>".
       [wstools] org.jboss.ws.WSException: Cannot load schema: [file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_dependentinfo59731.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_initreturn59733.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060201_EnrollmentSummaryParameters59737.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_logoninfoenroller59730.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060201_EnrollmentSummary59738.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_hostinfo59732.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_employeeinfo59726.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_benefitinfo59727.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_microsoft.com_wsdl_types_59735.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_logoninfoemployee59729.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_headerinfo59734.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_htmllayoutinfo59728.xsd, file:/C:/DOCUME~1/ACHATT~1.000/LOCALS~1/Temp/JBossWS_www.plane.biz_exchange_20060125_sessionstatus59736.xsd]
       [wstools] at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:191)
       [wstools] at org.jboss.ws.metadata.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:227)
       [wstools] at org.jboss.ws.metadata.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:118)
       [wstools] at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:145)
       [wstools] at org.jboss.ws.tools.WSDLToJava.convertWSDL2Java(WSDLToJava.java:110)
       [wstools] at org.jboss.ws.tools.helpers.ToolsHelper.handleWSDLToJavaGeneration(ToolsHelper.java:322)
       [wstools] at org.jboss.ws.tools.WSTools.process(WSTools.java:132)
       [wstools] at org.jboss.ws.tools.WSTools.generate(WSTools.java:119)
       [wstools] at org.jboss.ws.tools.ant.wstools.execute(wstools.java:103)
       [wstools] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       [wstools] at org.apache.tools.ant.Task.perform(Task.java:364)
       [wstools] at org.apache.tools.ant.Target.execute(Target.java:341)
       [wstools] at org.apache.tools.ant.Target.performTasks(Target.java:369)
       [wstools] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
       [wstools] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
       [wstools] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
       [wstools] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
       [wstools] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
       [wstools] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
       [wstools] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
      
      BUILD FAILED
      C:\home\tools\workspace\CPIWebserviceProduct\build\build.xml:66: Error running jbossws:
      
      


      If something is wrong on my end..plz do lemme know.

      THanx
      ABhi