开发者

axis2 array of object that contains a list

开发者 https://www.devze.com 2023-02-11 18:24 出处:网络
I have to return an object using axis2 webservice. The object contains a list of other object. The WSDL shows up as xs:anyType. When retreiving the object from client it shows up as org.apache.axiom.o

I have to return an object using axis2 webservice. The object contains a list of other object. The WSDL shows up as xs:anyType. When retreiving the object from client it shows up as org.apache.axiom.om.i开发者_Go百科mpl.llom.OMElementImpl

how to use axis2 to retreive an object that contains a list


You cannot take a complex object, return it with a web service and expect the client to reconstruct a object perfectly identical to the original. Remember the wsdl is an abstraction of the web service implementation. Also, clients may be written in a language with a different feature set.

The trick is to have your web services return data types that are as simple as possible. Anything from elementary types to simple java beans based on elementary types will work well. In your case, return an array instead of a List.

I have mentionned Java because it sounded like you could be using this language. It may not be the case, but the general rules I have outlined still apply.


Phillippe A. is right.

Instead of lists of objects, you want to return arrays of objects.

0

精彩评论

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

关注公众号