[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Re: webmethod within a jsp-file

Fugee47 do-not-reply at jboss.com
Fri Mar 7 05:59:43 EST 2008


now 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 (and it is one !!)

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

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



More information about the jboss-user mailing list