Just starting to write a web service client and I'm having trouble with the 1st example.

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class TestClient
{
   public static void main(String [] args) {
       try {
           String endpoint =
                    "http://nagoya.apache.org:5049/axis/services/echo";;

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

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


String ret = (String) call.invoke( new Object[] { "Hello!" } );

           System.out.println("Sent 'Hello!', got '" + ret + "'");
       } catch (Exception e) {
           System.err.println(e.toString());
       }
   }
}

This code compiles successfully.
When I run it in the command line I get the following;

java.lang.ExceptionInInitializerError:
at org.apache.axis.client.Service.getAxisClient(Service.java:143)
at org.apache.axis.client.Service.<init>(Service.java:152)
at TestClient.main(TestClient.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)


Any help would be appreciated.

TIA


Mitch Shiller [EMAIL PROTECTED]



Reply via email to