Java client for webservices

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());
}
}
}

..............................................................
 
C

Cristiano Sadun

(e-mail address removed) (Fran) wrote in
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.

The easiest way with Axis is to use the wsdl2java tool, which takes a WSDL
and creates corresponding set of java classes (in source), which methods
wrap the webservice call code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top