Java client for webservices

Discussion in 'Java' started by Fran, Jul 6, 2004.

  1. Fran

    Fran Guest

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

    ..............................................................
    Fran, Jul 6, 2004
    #1
    1. Advertising

  2. (Fran) wrote in
    news::

    > 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.
    Cristiano Sadun, Jul 6, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    400
  2. Jukka Kenttälä

    Webservices and vb6 client

    Jukka Kenttälä, Jul 9, 2003, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    337
    Abhuday Aggarwal [MS]
    Jul 17, 2003
  3. Paul Gorman

    Client Side Webservices

    Paul Gorman, Dec 10, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    145
    Michel
    Dec 16, 2003
  4. Jack Wright
    Replies:
    3
    Views:
    242
    Emil Kvarnhammar
    Jul 30, 2004
  5. Anin via .NET 247

    need to help to copy file from server to client through webservices

    Anin via .NET 247, Mar 23, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    174
    Keenan Newton
    Mar 24, 2005
Loading...

Share This Page