1 Reply Latest reply on Mar 7, 2008 3:11 PM by peterj

    Problems getting client to work

    fugee47

      i got a standalone java-client working:

      package simpleclient;

      import javax.xml.ws.WebServiceRef;
      import helloservice.endpoint.HelloService;
      import helloservice.endpoint.Hello;

      public class HelloClient {
      @WebServiceRef(wsdlLocation="http://localhost:8080/helloservice/Hello?wsdl")
      static HelloService service = new HelloService();

      public static void main(String[] args) {
      System.out.println("Retrieving the port from the following service: " + service);
      Hello port = service.getHelloPort();
      System.out.println("Invoking the sayHello operation on the port.");
      String name;
      if (args.length > 0) {
      name = args[0];
      } else {
      name = "No Name";
      }
      String response = port.sayHello(name);
      System.out.println(response);
      }
      }


      but when i copy the code into a new function and access it from within a jsp-file, i get errors.

      package simpleclient;

      import javax.xml.ws.WebServiceRef;
      import helloservice.endpoint.HelloService;
      import helloservice.endpoint.Hello;

      public class HelloClient {
      @WebServiceRef(wsdlLocation="http://localhost:8080/helloservice/Hello?wsdl")
      static HelloService service = new HelloService();

      public static String say(String args) {
      Hello port = service.getHelloPort();
      String name;
      if (args != null) {
      name = args;
      } else {
      name = "No Name";
      }
      String response = port.sayHello(name);
      return response;
      }
      }



      ERROR [ServiceDelegateImpl] Cannot create proxy for SEI helloservice.endpoint.Hello from: vfsfile:/opt/jboss-5.0.0.Beta4/server/default/deploy/
      11:51:14,647 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.IllegalArgumentException: helloservice.endpoint.Hello is not an interface

      i dont understand this error, since the standalone client does not complain about helloservice.endpoint.Hello being not an interface