[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 03:55:33 EDT 2008


Sure:

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();
  |    }
  |    
  | }
  | 

It is directly from the client example on the page:
http://jbws.dyndns.org/mediawiki/index.php?title=Native_WS-ReliableMessaging_Tutorial#Updating_Client_Code_to_Reference_Custom_JAX-WS_Config_File_and_Close_the_Sequence

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

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



More information about the jboss-user mailing list