[JBossWS] - Re: NoSuchMethodError on TypeBinding.setBeforeMarshallingCal
by joshlam
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?...";
| 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
17 years, 10 months
[JBossWS] - NullPointerException in WSDL11Reader.processOperationInput
by meghanai_99
Hello,
I have JBoss 4.0.5GA and JBPM and trying to deploy my BPEL process to JBoss. I could generate the Java classes for my BPEL using wscompile after replacing <xsd:include> with <xsd:import>. However when I deploy it over to JBoss I get following exception -
11:44:16,567 ERROR [MainDeployer] Could not create deployment: file:/D:/jboss-4.
0.5.GA/server/default/deploy/studio.war
java.lang.NullPointerException
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processOperationInput(WSDL11R
eader.java:474)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPortTypeOperations(WSD
L11Reader.java:460)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPortType(WSDL11Reader.
java:446)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processBinding(WSDL11Reader.j
ava:728)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPort(WSDL11Reader.java
:1071)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPorts(WSDL11Reader.jav
a:1054)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processServices(WSDL11Reader.
java:1027)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processDefinition(WSDL11Reade
r.java:119)
at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitio
nsFactory.java:145)
Please let me know why this class throws above exception.
Thank you,
Meghana
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020700#4020700
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020700
17 years, 10 months
[JBossWS] - receiving a AxisFault in the client
by flaviafm
Hi all,
I'm starting study Web services and I'm trying to use a client to test the web service that I just create and I'm receiving the follow error em I execute the client program. I'm using Eclipse 3.2 and Jboss4.0.1ps1
The client source is :
| package com.myapp;
|
| import javax.xml.namespace.QName;
| import javax.xml.rpc.Call;
| import javax.xml.rpc.Service;
| import javax.xml.rpc.ServiceFactory;
| import javax.xml.rpc.ParameterMode;
|
|
| public class DIIClient {
|
| // modified from sun j2ee jaxrpc example
|
| private static String endpoint = "http://localhost:8080/simple-ws4ee/ws4ee/services/HelloWorld";
| private static String qnameService = "HelloWorldService";
| private static String qnamePort = "HelloWorld";
|
| private static String ENCODING_STYLE_PROPERTY ="javax.xml.rpc.encodingstyle.namespace.uri";
| private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
| private static String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
|
|
| public static void main(String[] args) {
|
| System.out.println("Endpoint address = " + endpoint);
|
| try {
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(new QName(qnameService));
|
| QName port = new QName(qnamePort);
|
| Call call = service.createCall(port);
| call.setTargetEndpointAddress(endpoint);
|
| call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
| call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
| call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
| QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
| call.setReturnType(QNAME_TYPE_STRING);
|
|
| call.setOperationName(new QName(endpoint, "getHelloWorld"));
| call.addParameter("String_1", QNAME_TYPE_STRING, ParameterMode.IN);
| String[] params = { "jboss!" };
|
| String result = (String)call.invoke(params);
| System.out.println(result);
|
| } catch (Exception ex) {
| ex.printStackTrace();
| }
| }
| }
|
The error is:
| AxisFault
| faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
| faultSubcode:
| faultString: java.lang.NullPointerException
| faultActor:
| faultNode:
| faultDetail:
| {http://xml.apache.org/axis/}stackTrace: java.lang.NullPointerException
| at java.util.Hashtable.put(Unknown Source)
| at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
| at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:263)
| at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:657)
| at org.apache.axis.Message.getSOAPEnvelope(Message.java:430)
| at org.apache.axis.Message.getContentType(Message.java:496)
| at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
| at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
| at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
| at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:160)
| at org.apache.axis.SimpleChain.invoke(SimpleChain.java:123)
| at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:126)
| at org.apache.axis.client.Call.invokeEngine(Call.java:3029)
| at org.apache.axis.client.Call.invoke(Call.java:3014)
| at org.apache.axis.client.Call.invoke(Call.java:2608)
| at org.apache.axis.client.Call.invoke(Call.java:2513)
| at org.apache.axis.client.Call.invokeInternal(Call.java:1973)
| at org.apache.axis.client.Call.invoke(Call.java:1914)
| at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
| at com.myapp.DIIClient.main(DIIClient.java:47)
|
|
| org.apache.axis.AxisFault: java.lang.NullPointerException
| at org.apache.axis.AxisFault.makeFault(AxisFault.java:146)
| at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:136)
| at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
| at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:160)
| at org.apache.axis.SimpleChain.invoke(SimpleChain.java:123)
| at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:126)
| at org.apache.axis.client.Call.invokeEngine(Call.java:3029)
| at org.apache.axis.client.Call.invoke(Call.java:3014)
| at org.apache.axis.client.Call.invoke(Call.java:2608)
| at org.apache.axis.client.Call.invoke(Call.java:2513)
| at org.apache.axis.client.Call.invokeInternal(Call.java:1973)
| at org.apache.axis.client.Call.invoke(Call.java:1914)
| at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
| at com.myapp.DIIClient.main(DIIClient.java:47)
| Caused by: java.lang.NullPointerException
| at java.util.Hashtable.put(Unknown Source)
| at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
| at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:263)
| at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:657)
| at org.apache.axis.Message.getSOAPEnvelope(Message.java:430)
| at org.apache.axis.Message.getContentType(Message.java:496)
| at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
| at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
| ... 12 more
|
When I test my web service with Eclipse Web services Explorer I receive the right response. What is wrong with my client?
thanks,
Fmachado
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020611#4020611
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020611
17 years, 10 months