Hi,
There is no GetStudent class in the generated code.
Remove 'import student.StudentStudentSOAP12PortStub.GetStudent;'
And remove GetStudent object as follows and use getStudent() instead.
public static void getStudent(StudentStudentSOAP12PortStub stub){
try{
// REMOVE getStudent req = new getStudent();
GetStudentResponse res = stub.getStudent(); // USE getStudent()
System.out.println(res.get_return());
} catch(Exception e){
e.printStackTrace();
System.out.println('\n\n\n');
}
}
You are using Axis2 1.2. Axis2 1.3 was released some time back.
Upul
On 10/7/07, shams jawaid <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I am trying to call a webservice as follows:
>
> package student;
> public class Student {
> public String name = 'student';
> public String id = 'five';
>
> public String getName() {
> return name;
> }
> public String getID() {
> return id;
> }
> public Student getStudent(){
> return new Student();
> }
> }
>
> i am actually trying to return an object instead of just a string, so this
> was just a test. I generated a stub of this file, and used my client as
> follows:
>
> package student;
> import student.StudentStudentSOAP12PortStub.GetStudent;
> import student.StudentStudentSOAP12PortStub.GetStudentResponse;
>
>
> public class Client{
> public static void main(java.lang.String args[]){
> try{
> StudentStudentSOAP12PortStub stub =
> new StudentStudentSOAP12PortStub
> ('http://localhost:8080/axis2/services/Student'<http://localhost:8080/axis2/services/Student%27>
> );
> getStudent(stub);
>
>
> } catch(Exception e){
> e.printStackTrace();
> System.out.println('\n\n\n');
> }
> }
> /* call an object*/
> public static void getStudent(StudentStudentSOAP12PortStub stub){
> try{
> getStudent req = new getStudent();
> GetStudentResponse res = stub.getStudent(req);
>
> System.out.println(res.get_return());
> }
> catch(Exception e){
> e.printStackTrace();
> System.out.println('\n\n\n');
> }
> }
> }
>
> however, i keep getting this error when using ant to build the client into
> a jar file :
>
> C:\Axis2 1.3\bin>ant
> Buildfile: build.xml
> init:
> pre.compile.test:
> [echo] Stax Availability= true
> [echo] Axis2 Availability= true
> compile.src:
> [javac] Compiling 3 source files to C:\Axis2 1.3\bin\build\classes
> [javac] C:\Axis2 1.3\bin\src\student\Client.java:3: cannot find symbol
> [javac] symbol : class GetStudent
> [javac] location: class student.StudentStudentSOAP12PortStub
> [javac] import student.StudentStudentSOAP12PortStub.GetStudent;
> [javac]
> ^
> [javac] C:\Axis2 1.3\bin\src\student\Client.java:28: cannot find
> symbol
> [javac] symbol : class getStudent
> [javac] location: class student.Client
> [javac] getStudent req = new getStudent();
> [javac] ^
> [javac] C:\Axis2 1.3\bin\src\student\Client.java:28: cannot find
> symbol
> [javac] symbol : class getStudent
> [javac] location: class student.Client
> [javac] getStudent req = new getStudent();
> [javac] ^
> [javac] Note: Some input files use unchecked or unsafe operations.
> [javac] Note: Recompile with -Xlint:unchecked for details.
> [javac] 3 errors
> BUILD FAILED
> C:\Axis2 1.3\bin\build.xml:43: Compile failed; see the compiler error
> output for
> details.
> Total time: 4 seconds
> C:\Axis2 1.3\bin>
>
> i tried to fix this error many times, by changing the small g to a capital
> G as it sometimes shows in the stub, but doesnt work.
>
>
> i will attach the webserivce, client and stub files. if anyone has a
> working example of a web service returning a simple object, please let me
> know,
>
> thanks!
>
>
>
> ------------------------------
> Do you know a place like the back of your hand? Share local knowledge with
> BackOfMyHand.com <http://www.backofmyhand.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>