>From the error it appears that the main is not even getting invoked.
How are you invoking this from the command line?

You have to invoke the 

java samples.userguide.example1.Calculator

Not simply 

java Calculator


Stephen James

-----Original Message-----
From: Charitha Kankanamge [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 06, 2007 6:30 AM
To: [email protected]
Subject: Re: Simple Java Client

Sneha,
What is the axis version you are using? If you are new to java web
services, I would recommend you to use Axis2. Please have a look at
Axis2 user documentation (http://ws.apache.org/axis2/1_3/toc.html) and
the following references to have a basic understanding on Axis2 web
services.

[1] http://wso2.org/library/95
[2]
http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using
-apache-axis2.html
[3] If you are using Eclipse IDE for Java development, have a look at
http://wso2.org/library/1719

Let us know if you cannot get it working with the help of the above
documents.

regards
Charitha

sneha jain wrote:

> Hi Charitha,
>
> I did try those methods but me being new to webservices and java as 
> well messed up the whole thing..
> Right now m tryin to build a simple client which doesnt use stubs -
>
> the client code is -
>
> package samples.userguide.example1;
>
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
>
> import javax.xml.namespace.QName;
> import java.lang.*;
>
> public class Calculator
> {
>    public static void main(String [] args) {
>        try {
>            String endpoint =
>                     "http://localhost:8080/axis/Calculator";;
>           
>            Integer i1 = new Integer(2);
>            Integer i2 = new Integer(3);
>           
>            Service  service = new Service();
>            Call     call    = (Call) service.createCall ();
>
>            call.setTargetEndpointAddress( new java.net.URL(endpoint)
);
>            call.setOperationName("add");
>            call.addParameter( "in0",org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN <http://javax.xml.rpc.ParameterMode.IN>
);
>            call.addParameter(
> "in1",org.apache.axis.Constants.XSD_INT,javax.xml.rpc.ParameterMode.IN
> <http://javax.xml.rpc.ParameterMode.IN> );
>            call.setReturnType( org.apache.axis.Constants.XSD_INT );
>            // Call to addParameter/setReturnType as described in 
> user-guide.html
>            //call.addParameter("testParam",
>            //                  org.apache.axis.Constants.XSD_STRING,
>            //                  javax.xml.rpc.ParameterMode.IN 
> <http://javax.xml.rpc.ParameterMode.IN>);
>            //call.setReturnType(org.apache.axis.Constants.XSD_STRING 
> );
>
>            Integer ret = (Integer) call.invoke( new Object[] { i1, i2 
> } );
>
>            System.out.println("Result:" + ret);
>        } catch (Exception e) {
>            System.err.println(e.toString ());
>            e.printStackTrace();
>        }
>    }
> }
>
> m getting error - Exception in thread "main" 
> java.lang.NoClassDefFoundError: Calculator
>
> m not able to resolve this!!
> On 9/6/07, *Charitha Kankanamge* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Hi Sneha,
>     Did you try [1], [2] in Apache Axis2 web page? It includes a lot
of
>     information on creating web service clients.
>
>     [1]http://ws.apache.org/axis2/1_3/quickstartguide.html#clientadb
>     [2]http://ws.apache.org/axis2/1_3/userguide-
>     creatingclients.html#choosingclient
>
>     regards
>     Charitha
>
>     sneha jain wrote:
>
>     > Hi,
>     >
>     > I am trying to create a Java Client to talk to a C Calculator
web
>     > service ..
>     > I am totally new to webservices. I have seen many methods to
create
>     > clients on the site..
>     > I tried many methods too but was not successful.
>     > Can you please suggest me how do i go about it?
>     >
>     > Cheers,
>     > Sneha
>
>
>
>
>
---------------------------------------------------------------------
>     To unsubscribe, e-mail: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>     For additional commands, e-mail: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to