开发者

Returning a string array from a web service

开发者 https://www.devze.com 2023-03-03 17:56 出处:网络
I have created a web service for the following code but I am getting an exception: org.apache.axis.InternalException:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号