Hi,

I have created a web service using jbossws and hosted on jboss-4.0.5.GA on 
WinXP and with the wstool generated the client artifacts.  No problem invoking 
the web service using SOAPUI tool.  But when I tried to execute the client 
code, upon call

Service service = serviceFactory.createService(wsdlURL, SERVICE_NAME, 
jaxrpcURL);  (pls see the client code below)

The following exception was thrown:


  | java.lang.NoSuchMethodError: 
org.jboss.xb.binding.sunday.unmarshalling.TypeBinding.setBeforeMarshallingCallback(Lorg/jboss/xb/binding/sunday/marshalling/TermBeforeMarshallingCallback;)V
  |     at 
org.jboss.ws.xop.JBossXBContentAdapter.register(JBossXBContentAdapter.java:210)
  |     at 
org.jboss.ws.jbossxb.SchemaBindingBuilder.buildSchemaBinding(SchemaBindingBuilder.java:85)
  |     at 
org.jboss.ws.metadata.ServiceMetaData.getSchemaBinding(ServiceMetaData.java:343)
  |     at 
org.jboss.ws.metadata.ServiceMetaData.eagerInitialize(ServiceMetaData.java:442)
  |     at 
org.jboss.ws.metadata.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:183)
  |     at 
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:132)
  |     at 
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:85)
  |     at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:96)
  |     at 
org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:158)
  |     at 
org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:143)
  |     at 
com.intuit.sds.prs.webservices.std.client.StdClientTest.testWebservice(StdClientTest.java:40)
  |     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)
  | 

Here is my client code (in the form of a junit test)

  | package com.intuit.sds.prs.webservices.std.client;
  | 
  | import java.io.File;
  | import java.net.MalformedURLException;
  | import java.net.URL;
  | import java.rmi.RemoteException;
  | 
  | import javax.xml.namespace.QName;
  | import javax.xml.rpc.Call;
  | import javax.xml.rpc.Service;
  | import javax.xml.rpc.ServiceException;
  | 
  | import org.apache.log4j.xml.DOMConfigurator;
  | import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
  | 
  | import com.intuit.sds.prs.webservices.AddressContactMethod;
  | import com.intuit.sds.prs.webservices.StandardizeAddressResponse;
  | 
  | import junit.framework.TestCase;
  | 
  | public class StdClientTest extends TestCase
  | {
  |     private static final String WSDL_LOCATION = 
"http://localhost:8080/StdWebserviceImpl-2/StandardizeAddressSLSBEndPoint?wsdl";;
  |     private static String NAMESPACE = 
"http://com.intuit.sds.prs/webservices";;
  |     private static final QName SERVICE_NAME = new QName(NAMESPACE, 
"StandardizeAddressWebService");
  |     
  |     public void testWebservice()
  |     {
  |             System.setProperty("javax.xml.rpc.ServiceFactory", 
"org.jboss.webservice.client.ServiceFactoryImpl");
  |             DOMConfigurator.configure("./src/log4j.xml");
  |             
  |             AddressContactMethod addr = new AddressContactMethod();
  |             try
  |             {
  |                     URL wsdlURL = new URL(WSDL_LOCATION);
  |                     URL jaxrpcURL = null;
  |                     jaxrpcURL = new File("src/jaxrpc-mapping.xml").toURL();
  |                     
  |                     ServiceFactoryImpl serviceFactory = new 
ServiceFactoryImpl();
  |                     Service service = serviceFactory.createService(wsdlURL, 
SERVICE_NAME, jaxrpcURL);
  |                     Call call = service.createCall();
  |                     
  |                     QName operationName = new QName(NAMESPACE, 
"standardizeAddress");
  |                     call.setOperationName(operationName);
  |                             
  |                     //Test the call
  |                     StandardizeAddressResponse ctr = 
(StandardizeAddressResponse) call.invoke(new Object[]{addr});
  |                     AddressContactMethod rAddr = ctr.getResult();
  |                     System.out.println("Addr1: " + rAddr.getAddr1());
  |             }
  |             catch (Exception e)
  |             {
  |                     // TODO Auto-generated catch block
  |                     e.printStackTrace();
  |             }
  |     }
  | }
  | 

Here the following is the wsdl and the jaxrpc-mapping.xml respectively

  | <definitions name="StandardizeAddressWebService" 
targetNamespace="http://com.intuit.sds.prs/webservices"; 
xmlns="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:ns1="http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws";
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://com.intuit.sds.prs/webservices"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  |   <types>
  |     <schema elementFormDefault="qualified" 
targetNamespace="http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws";
 xmlns="http://www.w3.org/2001/XMLSchema"; 
xmlns:ns1="http://com.intuit.sds.prs/webservices"; 
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:tns="http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  |       <import namespace="http://com.intuit.sds.prs/webservices"; />
  |       <complexType name="AddressContactMethod">
  |         <sequence>
  |           <element name="addr1" nillable="true" type="string" />
  |           <element name="addr2" nillable="true" type="string" />
  |           <element name="city" nillable="true" type="string" />
  |           <element name="countryCode" nillable="true" type="string" />
  |           <element name="postalCode" nillable="true" type="string" />
  |           <element name="postalCodeExt" nillable="true" type="string" />
  |           <element name="stateProvince" nillable="true" type="string" />
  |         </sequence>
  |       </complexType>
  |       <complexType name="IndividualName">
  |         <sequence>
  |           <element name="firstName" nillable="true" type="string" />
  |           <element name="lastName" nillable="true" type="string" />
  |         </sequence>
  |       </complexType>
  |     </schema>
  |     <schema elementFormDefault="qualified" 
targetNamespace="http://com.intuit.sds.prs/webservices"; 
xmlns="http://www.w3.org/2001/XMLSchema"; 
xmlns:ns2="http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws";
 xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:tns="http://com.intuit.sds.prs/webservices"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  |       <import 
namespace="http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws";
 />
  |       <complexType name="standardizeAddress">
  |         <sequence>
  |           <element name="AddressContactMethod_1" nillable="true" 
type="ns2:AddressContactMethod" />
  |         </sequence>
  |       </complexType>
  |       <complexType name="standardizeAddressResponse">
  |         <sequence>
  |           <element name="result" nillable="true" 
type="ns2:AddressContactMethod" />
  |         </sequence>
  |       </complexType>
  |       <complexType name="standardizeName">
  |         <sequence>
  |           <element name="IndividualName_1" nillable="true" 
type="ns2:IndividualName" />
  |         </sequence>
  |       </complexType>
  |       <complexType name="standardizeNameResponse">
  |         <sequence>
  |           <element name="result" nillable="true" type="ns2:IndividualName" 
/>
  |         </sequence>
  |       </complexType>
  |       <element name="standardizeAddress" type="tns:standardizeAddress" />
  |       <element name="standardizeAddressResponse" 
type="tns:standardizeAddressResponse" />
  |       <element name="standardizeName" type="tns:standardizeName" />
  |       <element name="standardizeNameResponse" 
type="tns:standardizeNameResponse" />
  |     </schema>
  |   </types>
  |   <message name="EndpointInterface_standardizeName">
  |     <part element="tns:standardizeName" name="parameters" />
  |   </message>
  |   <message name="EndpointInterface_standardizeNameResponse">
  |     <part element="tns:standardizeNameResponse" name="result" />
  |   </message>
  |   <message name="EndpointInterface_standardizeAddressResponse">
  |     <part element="tns:standardizeAddressResponse" name="result" />
  |   </message>
  |   <message name="EndpointInterface_standardizeAddress">
  |     <part element="tns:standardizeAddress" name="parameters" />
  |   </message>
  |   <portType name="EndpointInterface">
  |     <operation name="standardizeAddress">
  |       <input message="tns:EndpointInterface_standardizeAddress" />
  |       <output message="tns:EndpointInterface_standardizeAddressResponse" />
  |     </operation>
  |     <operation name="standardizeName">
  |       <input message="tns:EndpointInterface_standardizeName" />
  |       <output message="tns:EndpointInterface_standardizeNameResponse" />
  |     </operation>
  |   </portType>
  |   <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
  |     <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"; />
  |     <operation name="standardizeAddress">
  |       <soap:operation soapAction="" />
  |       <input>
  |         <soap:body use="literal" />
  |       </input>
  |       <output>
  |         <soap:body use="literal" />
  |       </output>
  |     </operation>
  |     <operation name="standardizeName">
  |       <soap:operation soapAction="" />
  |       <input>
  |         <soap:body use="literal" />
  |       </input>
  |       <output>
  |         <soap:body use="literal" />
  |       </output>
  |     </operation>
  |   </binding>
  |   <service name="StandardizeAddressWebService">
  |     <port binding="tns:EndpointInterfaceBinding" 
name="EndpointInterfacePort">
  |       <soap:address 
location="http://SDGL04301034:8080/StdWebserviceImpl-2/StandardizeAddressSLSBEndPoint";
 />
  |     </port>
  |   </service>
  | </definitions>
  | 


  | <?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 
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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
  |  <package-mapping>
  |   <package-type>com.intuit.sds.prs.webservices</package-type>
  |   <namespaceURI>http://com.intuit.sds.prs/webservices</namespaceURI>
  |  </package-mapping>
  |  <java-xml-type-mapping>
  |   <java-type>com.intuit.sds.prs.webservices.StandardizeAddress</java-type>
  |   <root-type-qname 
xmlns:typeNS='http://com.intuit.sds.prs/webservices'>typeNS:standardizeAddress</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>addressContactMethod_1</java-variable-name>
  |    <xml-element-name>AddressContactMethod_1</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  |  <java-xml-type-mapping>
  |   <java-type>com.intuit.sds.prs.webservices.AddressContactMethod</java-type>
  |   <root-type-qname 
xmlns:typeNS='http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws'>typeNS:AddressContactMethod</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>addr1</java-variable-name>
  |    <xml-element-name>addr1</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>addr2</java-variable-name>
  |    <xml-element-name>addr2</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>city</java-variable-name>
  |    <xml-element-name>city</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>countryCode</java-variable-name>
  |    <xml-element-name>countryCode</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>postalCode</java-variable-name>
  |    <xml-element-name>postalCode</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>postalCodeExt</java-variable-name>
  |    <xml-element-name>postalCodeExt</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>stateProvince</java-variable-name>
  |    <xml-element-name>stateProvince</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  |  <java-xml-type-mapping>
  |   
<java-type>com.intuit.sds.prs.webservices.StandardizeAddressResponse</java-type>
  |   <root-type-qname 
xmlns:typeNS='http://com.intuit.sds.prs/webservices'>typeNS:standardizeAddressResponse</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>result</java-variable-name>
  |    <xml-element-name>result</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  |  <java-xml-type-mapping>
  |   <java-type>com.intuit.sds.prs.webservices.StandardizeName</java-type>
  |   <root-type-qname 
xmlns:typeNS='http://com.intuit.sds.prs/webservices'>typeNS:standardizeName</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>individualName_1</java-variable-name>
  |    <xml-element-name>IndividualName_1</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  |  <java-xml-type-mapping>
  |   <java-type>com.intuit.sds.prs.webservices.IndividualName</java-type>
  |   <root-type-qname 
xmlns:typeNS='http://objects.interfaces.ws.standardization.prs.sds.intuit.com/jaws'>typeNS:IndividualName</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>firstName</java-variable-name>
  |    <xml-element-name>firstName</xml-element-name>
  |   </variable-mapping>
  |   <variable-mapping>
  |    <java-variable-name>lastName</java-variable-name>
  |    <xml-element-name>lastName</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  |  <java-xml-type-mapping>
  |   
<java-type>com.intuit.sds.prs.webservices.StandardizeNameResponse</java-type>
  |   <root-type-qname 
xmlns:typeNS='http://com.intuit.sds.prs/webservices'>typeNS:standardizeNameResponse</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>result</java-variable-name>
  |    <xml-element-name>result</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  |  <service-interface-mapping>
  |   
<service-interface>com.intuit.sds.prs.webservices.StandardizeAddressWebService</service-interface>
  |   <wsdl-service-name 
xmlns:serviceNS='http://com.intuit.sds.prs/webservices'>serviceNS:StandardizeAddressWebService</wsdl-service-name>
  |   <port-mapping>
  |    <port-name>EndpointInterfacePort</port-name>
  |    <java-port-name>EndpointInterfacePort</java-port-name>
  |   </port-mapping>
  |  </service-interface-mapping>
  |  <service-endpoint-interface-mapping>
  |   
<service-endpoint-interface>com.intuit.sds.prs.webservices.EndpointInterface</service-endpoint-interface>
  |   <wsdl-port-type 
xmlns:portTypeNS='http://com.intuit.sds.prs/webservices'>portTypeNS:EndpointInterface</wsdl-port-type>
  |   <wsdl-binding 
xmlns:bindingNS='http://com.intuit.sds.prs/webservices'>bindingNS:EndpointInterfaceBinding</wsdl-binding>
  |   <service-endpoint-method-mapping>
  |    <java-method-name>standardizeAddress</java-method-name>
  |    <wsdl-operation>standardizeAddress</wsdl-operation>
  |    <wrapped-element/>
  |    <method-param-parts-mapping>
  |     <param-position>0</param-position>
  |     
<param-type>com.intuit.sds.prs.webservices.AddressContactMethod</param-type>
  |     <wsdl-message-mapping>
  |      <wsdl-message 
xmlns:wsdlMsgNS='http://com.intuit.sds.prs/webservices'>wsdlMsgNS:EndpointInterface_standardizeAddress</wsdl-message>
  |      <wsdl-message-part-name>AddressContactMethod_1</wsdl-message-part-name>
  |      <parameter-mode>IN</parameter-mode>
  |     </wsdl-message-mapping>
  |    </method-param-parts-mapping>
  |    <wsdl-return-value-mapping>
  |     
<method-return-value>com.intuit.sds.prs.webservices.AddressContactMethod</method-return-value>
  |     <wsdl-message 
xmlns:wsdlMsgNS='http://com.intuit.sds.prs/webservices'>wsdlMsgNS:EndpointInterface_standardizeAddressResponse</wsdl-message>
  |     <wsdl-message-part-name>result</wsdl-message-part-name>
  |    </wsdl-return-value-mapping>
  |   </service-endpoint-method-mapping>
  |   <service-endpoint-method-mapping>
  |    <java-method-name>standardizeName</java-method-name>
  |    <wsdl-operation>standardizeName</wsdl-operation>
  |    <wrapped-element/>
  |    <method-param-parts-mapping>
  |     <param-position>0</param-position>
  |     <param-type>com.intuit.sds.prs.webservices.IndividualName</param-type>
  |     <wsdl-message-mapping>
  |      <wsdl-message 
xmlns:wsdlMsgNS='http://com.intuit.sds.prs/webservices'>wsdlMsgNS:EndpointInterface_standardizeName</wsdl-message>
  |      <wsdl-message-part-name>IndividualName_1</wsdl-message-part-name>
  |      <parameter-mode>IN</parameter-mode>
  |     </wsdl-message-mapping>
  |    </method-param-parts-mapping>
  |    <wsdl-return-value-mapping>
  |     
<method-return-value>com.intuit.sds.prs.webservices.IndividualName</method-return-value>
  |     <wsdl-message 
xmlns:wsdlMsgNS='http://com.intuit.sds.prs/webservices'>wsdlMsgNS:EndpointInterface_standardizeNameResponse</wsdl-message>
  |     <wsdl-message-part-name>result</wsdl-message-part-name>
  |    </wsdl-return-value-mapping>
  |   </service-endpoint-method-mapping>
  |  </service-endpoint-interface-mapping>
  | </java-wsdl-mapping>

The why I got this is to use wstool in an ant script:

  | <wstool config="./config.xml" dest="${gensrc.dir}">
  |     <classpath>
  |             <path refid="compile.classpath" />
  |     </classpath>
  | </wstool>

The config.xml used is:

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!--
  |   wstools -config wstools-config.xml
  | -->
  | 
  | <configuration xmlns="http://www.jboss.org/jbossws-tools";
  |    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  |    xsi:schemaLocation="http://www.jboss.org/jbossws-tools 
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd";>
  |   
  |   
  |   <wsdl-java location="src/main/resources/TestService.wsdl">
  |     <mapping file="../resources/META-INF/jaxrpc-mapping.xml" />
  |   </wsdl-java>
  |   
  | </configuration>

Would greatly appreciate any help on this.

Thanks.

--
Josh

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020415#4020415

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020415
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to