Question

i'm trying to develop a simple Hello World web service using Axis2 v1.5, Tomcat6 and Java 1.6, according to the following tutorial.

However, i'm getting an error in the client-side code compilation:

javac -extdirs C:\\axis2-1.5 org/apache/axis2/*.java  -d temp/

returns

code\src\org\apache\ws\axis2\Client.java:13: cannot find symbol
symbol  : method setParam0(java.lang.String)
location: class org.apache.axis2.TempStub.Echo
        request.setParam0("Hello world");

as you can see, i've made a couple of changes to the original tutorial, however, even after following the instructions exactly i still get the same error.

I also tried using an older version of Java with the -source 1.3 and -target 1.3 parameters for javac, but the issue remains.

Any ideas? For a simple tutorial, this crap has given me a lotta headaches...

Cheers and thanks in advance

Was it helpful?

Solution

The tutorial has a typo, it should be setValue, not setParam0, as in:

        HelloWorldStub.Echo request = new HelloWorldStub.Echo();
        request.setValue("My Parameter Value");

OTHER TIPS

I have also been trying to get this to work and by using jd-gui or jad I found that in the temp dir the SimpleServiceStub$Echo class has this method:

public void setArgs0(String paramString)
{
    if (paramString != null)
    {
        this.localArgs0Tracker = true;
    }
    else this.localArgs0Tracker = true;

    this.localArgs0 = paramString;
}

Based upon this in your Client.java you should use setArgs0("hello world");

I agree with Mark, that's a tutorial typo. The tutorial ws method was:

public String echo(String value) {
    return value;
}

so the associated client instruction should be: request.setValue("My Parameter Value");

Basically, if the web service method was:

public String echo(String whatever) {
    return whatever;
}

the associated client call would be: request.setWhatever("My Parameter Value");

Use this statement: request.setArgs0("Hello World");

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top