[jbossws-users] [JBossWS] - Re: NoSuchMethodError on TypeBinding.setBeforeMarshallingCal

joshlam do-not-reply at jboss.com
Thu Feb 22 15:01:08 EST 2007


Thanks Heiko!  You are right, somehow there was an 'extra' jboss-xml-binding.jar.

Now I ran into another problem while executing the code when I call call.invoke(new Object[]{stdAddr});.


  | java.rmi.RemoteException: Call invocation failed; nested exception is: 
  | 	java.lang.IllegalArgumentException: argument type mismatch
  | 	at org.jboss.ws.common.CommonClient.invoke(CommonClient.java:335)
  | 	at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:560)
  | 	at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:345)
  | 	at com.intuit.sds.prs.webservices.std.client.StdClientTest.testWebservice(StdClientTest.java:51)
  | 	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)
  | Caused by: java.lang.IllegalArgumentException: argument type mismatch
  | 	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 org.jboss.ws.jaxrpc.ParameterWrapping.wrapRequestParameters(ParameterWrapping.java:240)
  | 	at org.jboss.ws.binding.EndpointInvocation.initInputParams(EndpointInvocation.java:249)
  | 	at org.jboss.ws.common.CommonClient.invoke(CommonClient.java:243)
  | 	... 18 more

Here is my client test program again (with a little change from before)
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.jboss.ws.jaxrpc.ServiceFactoryImpl;
  | 
  | import com.intuit.sds.prs.webservices.AddressContactMethod;
  | import com.intuit.sds.prs.webservices.StandardizeAddress;
  | 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");
  | 		AddressContactMethod addr = new AddressContactMethod();
  | 		StandardizeAddress stdAddr = new StandardizeAddress();
  | 		stdAddr.setAddressContactMethod_1(addr);
  | 		
  | 			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[]{stdAddr});
  | 				AddressContactMethod rAddr = ctr.getResult();
  | 				System.out.println("Addr1: " + rAddr.getAddr1());
  | 			}
  | 			catch (Exception e){e.printStackTrace();}	
  | 	}
  | }

My original SEI is:
package com.intuit.sds.prs.standardization.ws.interfaces.slsb;
  | 
  | import javax.ejb.Remote;
  | import javax.ejb.Stateless;
  | import javax.jws.WebMethod;
  | import javax.jws.WebResult;
  | import javax.jws.WebService;
  | import javax.jws.soap.SOAPBinding;
  | 
  | import org.jboss.annotation.ejb.LocalBinding;
  | import org.jboss.annotation.ejb.Management;
  | import org.jboss.annotation.ejb.RemoteBinding;
  | import org.jboss.annotation.ejb.Service;
  | 
  | 
  | import com.intuit.sds.prs.standardization.ws.interfaces.IStandardizeAddressEndPoint;
  | import com.intuit.sds.prs.standardization.ws.interfaces.objects.AddressContactMethod;
  | import com.intuit.sds.prs.standardization.ws.interfaces.objects.IndividualName;
  | 
  | @WebService(name = "EndpointInterface",
  | 		serviceName="StandardizeAddressWebService",
  | 		targetNamespace="http://com.intuit.sds.prs/webservices")
  | 		
  | @SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
  | 
  | @Stateless
  | @Remote(IStandardizeAddressEndPoint.class)
  | @RemoteBinding(jndiBinding="/ejb3/EJB3EndpointInterface")
  | 
  | 
  | public class StandardizeAddressSLSBEndPoint implements
  | 		IStandardizeAddressEndPoint
  | {
  | 	
  | 
  | 	public StandardizeAddressSLSBEndPoint()
  | 	{
  | 		super();
  | 		// TODO Auto-generated constructor stub
  | 	}
  | 
  | 	@WebMethod
  | 	public AddressContactMethod standardizeAddress(AddressContactMethod addr)
  | 	{
  | 		// TODO Auto-generated method stub
  | 		AddressContactMethod addrCM = new AddressContactMethod();
  | 		addrCM.setAddr1("123 MAIN ST");
  | 		addrCM.setAddr2("");
  | 		addrCM.setCity("SAN DIEGO");
  | 		addrCM.setCountryCode("US");
  | 		addrCM.setPostalCode("92122");
  | 		addrCM.setPostalCodeExt("1234");
  | 		addrCM.setStateProvince("CA");
  | 		return  addrCM;
  | 	}
  | 	
  | 	@WebMethod
  | 	public IndividualName standardizeName(IndividualName aname)
  | 	{
  | 		IndividualName name = new IndividualName();
  | 		name.setFirstName("SpongeBob");
  | 		name.setLastName("Squarepants");
  | 		return name;
  | 	}
  | }
  | 

and the client artifacts are:
	------- EndpointInterface.java --------
  | 
  | package com.intuit.sds.prs.webservices;
  | public interface  EndpointInterface extends java.rmi.Remote
  | {
  | 
  |   public com.intuit.sds.prs.webservices.AddressContactMethod  standardizeAddress(com.intuit.sds.prs.webservices.AddressContactMethod addressContactMethod_1) throws  java.rmi.RemoteException;
  |   public com.intuit.sds.prs.webservices.IndividualName  standardizeName(com.intuit.sds.prs.webservices.IndividualName individualName_1) throws  java.rmi.RemoteException;
  | }
  | 
  | 	--------- StandardizeAddressWebService.java -------
  | 
  | package com.intuit.sds.prs.webservices;
  | import javax.xml.rpc.*; 
  | 
  | public interface  StandardizeAddressWebService extends  javax.xml.rpc.Service
  | {
  | 
  |      public com.intuit.sds.prs.webservices.EndpointInterface getEndpointInterfacePort() throws ServiceException;
  | 
  | }
  | 
  | 	------- StandardizeAddress ------
  | 	
  | 	
  | package com.intuit.sds.prs.webservices;
  | 
  | 
  | public class  StandardizeAddress
  | {
  | 
  | protected com.intuit.sds.prs.webservices.AddressContactMethod addressContactMethod_1;
  | public StandardizeAddress(){}
  | 
  | public StandardizeAddress(com.intuit.sds.prs.webservices.AddressContactMethod addressContactMethod_1){
  | this.addressContactMethod_1=addressContactMethod_1;
  | }
  | public com.intuit.sds.prs.webservices.AddressContactMethod getAddressContactMethod_1() { return addressContactMethod_1 ;}
  | 
  | public void setAddressContactMethod_1(com.intuit.sds.prs.webservices.AddressContactMethod addressContactMethod_1){ this.addressContactMethod_1=addressContactMethod_1; }
  | 
  | }
  | 
  | 	------- StandardizeAddressResponse ------
  | 			
  | package com.intuit.sds.prs.webservices;
  | 
  | 
  | public class  StandardizeAddressResponse
  | {
  | 
  | protected com.intuit.sds.prs.webservices.AddressContactMethod result;
  | public StandardizeAddressResponse(){}
  | 
  | public StandardizeAddressResponse(com.intuit.sds.prs.webservices.AddressContactMethod result){
  | this.result=result;
  | }
  | public com.intuit.sds.prs.webservices.AddressContactMethod getResult() { return result ;}
  | 
  | public void setResult(com.intuit.sds.prs.webservices.AddressContactMethod result){ this.result=result; }
  | 
  | }
  | 
  | 	------- AddressContactMethod -----	
  | 
  | package com.intuit.sds.prs.webservices;
  | 
  | 
  | public class  AddressContactMethod
  | {
  | 
  | protected java.lang.String addr1;
  | 
  | protected java.lang.String addr2;
  | 
  | protected java.lang.String city;
  | 
  | protected java.lang.String countryCode;
  | 
  | protected java.lang.String postalCode;
  | 
  | protected java.lang.String postalCodeExt;
  | 
  | protected java.lang.String stateProvince;
  | public AddressContactMethod(){}
  | 
  | public AddressContactMethod(java.lang.String addr1, java.lang.String addr2, java.lang.String city, java.lang.String countryCode, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String stateProvince){
  | this.addr1=addr1;
  | this.addr2=addr2;
  | this.city=city;
  | this.countryCode=countryCode;
  | this.postalCode=postalCode;
  | this.postalCodeExt=postalCodeExt;
  | this.stateProvince=stateProvince;
  | }
  | public java.lang.String getAddr1() { return addr1 ;}
  | 
  | public void setAddr1(java.lang.String addr1){ this.addr1=addr1; }
  | 
  | public java.lang.String getAddr2() { return addr2 ;}
  | 
  | public void setAddr2(java.lang.String addr2){ this.addr2=addr2; }
  | 
  | public java.lang.String getCity() { return city ;}
  | 
  | public void setCity(java.lang.String city){ this.city=city; }
  | 
  | public java.lang.String getCountryCode() { return countryCode ;}
  | 
  | public void setCountryCode(java.lang.String countryCode){ this.countryCode=countryCode; }
  | 
  | public java.lang.String getPostalCode() { return postalCode ;}
  | 
  | public void setPostalCode(java.lang.String postalCode){ this.postalCode=postalCode; }
  | 
  | public java.lang.String getPostalCodeExt() { return postalCodeExt ;}
  | 
  | public void setPostalCodeExt(java.lang.String postalCodeExt){ this.postalCodeExt=postalCodeExt; }
  | 
  | public java.lang.String getStateProvince() { return stateProvince ;}
  | 
  | public void setStateProvince(java.lang.String stateProvince){ this.stateProvince=stateProvince; }
  | 
  | }

Note I did not include the following artifacts:  StandardizeName.java, StandardizeNameResponse.java and IndividualName.java as I am not calling those.  These are all the artifacts generated by wsdl.  The mapping files and wsdl are as in the earlier post.

Would appreciate any help again.  I am really close to completing this.  Thanks.

--
Josh

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020782



More information about the jbossws-users mailing list