Returning a string array from a web service
I have created a web service for the following code but I am getting an exception:
org.apache.axis.InternalException: java.lang.Exception: Couldn't find a matching Java operation for WSDD operation "andrQues" (0 args)" on invoking the function.
public class Ques {
public String[] AndrQues(){
String ques[] = {"name??", "age??", "grade??"};
re开发者_开发知识库turn ques;
}
}
Does anyone know why its occuring or if it should be written in some other way?
I found the error. I was using envelope.getResponse() to retrive the returned values. Instead following should be written:
**KvmSerializable result = (KvmSerializable)envelope.bodyIn;
System.out.println("Result : " + result.getProperty(0).toString());**
This works fine to retrive values from an array.
精彩评论