[jboss-user] [JBossWS] - Re: Newbie question: Just a first webservice client

dirkschmitz do-not-reply at jboss.com
Wed Sep 6 05:35:16 EDT 2006


Hi!

i have a similar problem with my webservice test client using the dynamic invocation interface (DII). When I try to run the client within Eclipse I get the following Exception

Exception in thread "main" javax.xml.rpc.ServiceException: Provider com.sun.xml.rpc.client.ServiceFactoryImpl not found
	at javax.xml.rpc.FactoryFinder.newInstance(FactoryFinder.java:44)
	at javax.xml.rpc.FactoryFinder.find(FactoryFinder.java:137)
	at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:58)
	at de.mtag.ws.samples.client.WebServiceClient.main(WebServiceClient.java:29)

The classpath of the webservice testclient contains the following JBoss-Client-Jars

activation.jar
commons-logging.jar
javaassist.jar
jbossall-client.jar
jbossws-client.jar
log4j.jar
mail.jar



Web Service Test Client


  | public class WebServiceClient {
  | 
  | 	/**
  | 	 * @param args
  | 	 */
  | 	public static void main(String[] args) throws Exception
  |     {
  |         String urlstr   = args[0];
  |         String argument = args[1];
  | 
  |         System.out.println("Contacting webservice at " + urlstr);
  | 
  |         URL url =  new URL(urlstr);
  | 
  |         String ns        = "http://xx.xxx.ws.samples.services/simple";
  |         QName  qname     = new QName(ns, "SimpleWS");
  |         QName  port      = new QName(ns, "SimpleService");
  |         QName  operation = new QName(ns, "echo");
  |         
  |         ServiceFactory factory = ServiceFactory.newInstance();
  |         Service        service = factory.createService(url, qname);
  |         Call           call    = service.createCall(port, operation);
  | 
  |         System.out.println("SimpleService.echo(" + argument + ")");
  |         System.out.println("output:" + call.invoke(new Object[] {argument}));
  | 
  | 	}
  | 
  | }
  | 

Service Endpoint Interface


  | public interface SimpleService {
  | 	
  | 	public String echo(String echo);
  | 
  | }
  | 

Service Endpoint Implementation


  | @WebService(
  | 		name = "SimpleWS",
  | 	    targetNamespace = "http://xx.xxx.ws.samples.services/simple",
  | 	    serviceName = "SimpleWS"
  | 	 	)
  | @SOAPBinding(style = SOAPBinding.Style.RPC)
  | public class SimpleEndpoint implements SimpleService {
  | 
  | 	@WebMethod
  | 	public String echo(String theEcho) {
  | 		return theEcho;
  | 	}
  | 
  | }
  | 

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

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



More information about the jboss-user mailing list