[jboss-user] [JBossWS] - Re: WS-RM Exception: cannot be cast to org.jboss.ws.core.Stu
moweis
do-not-reply at jboss.com
Mon Aug 4 11:57:13 EDT 2008
Hi Richard,
You were right.
I went ahead and added all the jboss/jbossws jars to my classpath, and I no longer get the cannot be cast exception.
However, I get a new exception now:
anonymous wrote : Exception in thread "main" org.jboss.ws.extensions.wsrm.api.RMException: Unable to create WSRM sequence
| at org.jboss.ws.core.jaxws.client.ClientImpl.createSequence(ClientImpl.java:563)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
| at $Proxy16.ping(Unknown Source)
| at org.jboss.test.ws.jaxws.samples.wsrm.client.SimpleServiceTestCase.main(SimpleServiceTestCase.java:33)
| Caused by: javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
| at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:410)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:316)
| at org.jboss.ws.core.jaxws.client.ClientImpl.createSequence(ClientImpl.java:550)
| ... 4 more
| Caused by: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
| at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:441)
| at org.jboss.ws.core.soap.SOAPMessageImpl.(SOAPMessageImpl.java:84)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:171)
| at org.jboss.ws.core.CommonSOAP11Binding.createMessage(CommonSOAP11Binding.java:59)
| at org.jboss.ws.core.CommonSOAPBinding.bindRequestMessage(CommonSOAPBinding.java:158)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:292)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:304)
| ... 5 more
|
Here is my client code:
package org.jboss.test.ws.jaxws.samples.wsrm.client;
|
| import java.net.URL;
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
| import org.jboss.ws.core.StubExt;
| import org.jboss.ws.extensions.wsrm.api.RMProvider;
|
| import org.jboss.test.ws.jaxws.samples.wsrm.generated.SimpleService;
|
|
| public final class SimpleServiceTestCase
| {
|
| private static final String serviceURL = "http://localhost:8080/jaxws-samples-wsrm/SimpleService";
|
| public static void main(String[] args) throws Exception
| {
| String url = null;
| if ( args != null && args.length > 0 && args[0] != null )
| url = args[0];
| else
| url = serviceURL;
| System.out.println("Calling wsdl");
| QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleService");
| QName portName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleServicePort");
| URL wsdlURL = new URL(url + "?wsdl");
| Service service = Service.create(wsdlURL, serviceName);
| SimpleService proxy = (SimpleService)service.getPort(SimpleService.class);
|
| ((StubExt)proxy).setConfigName("Standard Anonymous WSRM Client", "META-INF/wsrm-jaxws-client-config.xml");
|
| proxy.ping(); // one way call
| proxy.echo("Hello World!"); // request responce call
| ((RMProvider)proxy).closeSequence();
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168502#4168502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168502
More information about the jboss-user
mailing list