F
Fran
Hello all,
I have made a WebServices in the IBM WSAD Ide tool and I have tested
it using a provided tester.
However I need to build a java client to call my webservices but I
don´t know how to do it.
I have found this sample code to call a Webservices but I have
compilation problems because I have not the following classes:
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
Could anybody say me where can I get this classes?, I have installed
the Java Web Services Developer Pack but these classes does not
appear.
Could anybody send me another one example to call Webservice?
Thank you very much,
Best regards.
Fran.
................................................................
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
public class TestClient
{
public static void main(String [] args) {
try {
String endpoint =
"http://www.vbnetexpert.com/vsm/timeservice";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName("GetLocal");
String ret = (String) call.invoke( new Object[] { "foo" } );
System.out.println("Sent 'foo', got '" + ret + "'");
}catch (Exception e) {
System.err.println(e.toString());
}
}
}
..............................................................
I have made a WebServices in the IBM WSAD Ide tool and I have tested
it using a provided tester.
However I need to build a java client to call my webservices but I
don´t know how to do it.
I have found this sample code to call a Webservices but I have
compilation problems because I have not the following classes:
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
Could anybody say me where can I get this classes?, I have installed
the Java Web Services Developer Pack but these classes does not
appear.
Could anybody send me another one example to call Webservice?
Thank you very much,
Best regards.
Fran.
................................................................
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
public class TestClient
{
public static void main(String [] args) {
try {
String endpoint =
"http://www.vbnetexpert.com/vsm/timeservice";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName("GetLocal");
String ret = (String) call.invoke( new Object[] { "foo" } );
System.out.println("Sent 'foo', got '" + ret + "'");
}catch (Exception e) {
System.err.println(e.toString());
}
}
}
..............................................................