0 Replies Latest reply on Aug 3, 2006 3:18 PM by T t

    Problem with web service client

    T t Newbie

      I followed adminguide.pdf and created simple web service similar to 'Hello, world'. I can see it in Registered Service Endpoints. I followed the same quide to create a simple client to test the web service. Here is the code:

      package org.jboss.ws.client;

      import java.net.URL;

      import javax.xml.namespace.QName;
      import javax.xml.rpc.Service;
      import javax.xml.rpc.ServiceFactory;

      import org.jboss.ws.hello.Hello;

      public class HelloClient {
      public static void main(String[] args) throws Exception{
      String urlstr = args[0];
      String argument = args[1];
      System.out.println("Contacting web service at " + urlstr);

      URL url = new URL(urlstr);
      QName qname = new QName("http://hello.ws.jboss.org/", "HelloService");

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(url, qname);
      Hello hello = (Hello) service.getPort(Hello.class);

      System.out.println("hello.hello(" + argument + ")");
      System.out.println("output:" + hello.hello(argument));

      But it always fails at this line "ServiceFactory factory = ServiceFactory.newInstance();"

      I made some debug and I found that it looks for System.property named 'javax.xml.rpc.ServiceFactory' but there si no property like that. After that it looks for file named 'jaxrpc.properties' and it didn't find anything and throws an exception. The file doesn't exist on the file system. So, I'm lost, I don't know what can be the problem. Maybe some settings? Any help is appreciated.