0 Replies Latest reply on Aug 6, 2004 5:09 AM by maniarkm

    targetService is null error when deploying .jws file

    maniarkm

      Hi,

      I cannot seem to connect using a command line client to a simple service that I have created and deployed as a single simple class file deployed as a .jws file into the jboss-net.war.

      Axis seems to be working fine and when I put the URL for my web service into a browse I get the response:

      There is a web service here. Click here to see the WSDL file.

      However, when I click on the link I get a page not found error.

      public class TestClient{
      public static void main(String [] args){

      int argslength = args.length;

      if(argslength > 0){

      try {
      String endpoint = args[0];
      Object[] params = new Object[argslength-2];

      for(int i=2;i<argslength;i++){
      params[i-2] = (Object)args;
      }

      Service service = new Service();
      Call call = (Call) service.createCall();

      call.setTargetEndpointAddress( new java.net.URL(endpoint) );
      call.setOperationName(new QName("http://soapinterop.org/", args[1]));

      Object ret = call.invoke( params );

      System.out.println("Sent to "+args[1]+", got 'returned something'");
      }
      catch (Exception e) {
      System.err.println(e.toString());
      }
      }
      }
      }

      I am using this as a kind of universal test client for my simple web services. I add the URL and the method to call and the parameters from the command line and they all seem to enter correctly.

      I am unsure whether I am using the call.setOperationName() method correctly. I copied this from the Axis User Guide.

      So the only reasonable assumption is that the I am doing something wrong with my deployment, or Axis has a problem with .jws files.

      Can anyone give me a hint or some help?

      Cheers,

      Mark