开发者

Write a python Client to pass xs:anyType argument to a webservice method in Java

开发者 https://www.devze.com 2023-02-18 12:16 出处:网络
I have written a small webservice[Axis2/Java] which exposes a method public String Fill(St开发者_C百科ring cacheName Object... varArgs) {

I have written a small webservice[Axis2/Java] which exposes a method


   public String Fill(St开发者_C百科ring cacheName Object... varArgs) {


      return "Sample return "+varArgs[0].toString()+" "+(new Integer(varArgs[1]));

   }

My client is a python suds client.



import suds;
import suds.client;
url="http://localhost:8989/pakg1/services/JavaCache?wsdl"
client=suds.client.Client(url)
print client.service.Fill("level1,"Immediate",123123);


The WSDL shows that the element varArgs as follows.


   xs:element maxOccurs="unbounded" minOccurs="0" name="varArgs" nillable="true" type="xs:anyType"

However Nothing comes in the Object array at run time. When I try to look at the array in debug mode it show that it is null.

Please advice how do I pass arguments to Fill method so that I can send an array, or a single basic type in varArgs parameter.

Thanks, Dhawal.


Have you tried passing your varArgs as a python list? See if something like this works:

client.service.Fill("level1",["Immediate",123123])


The problem is at the axis2 side. The Axis2 is unable to deserialize Object and mistakes it as a DataHandler. I have decided to pass in my Object as OMElement and then deserialize myself.

Have reported the issue with Axis2 also.

Thanks

0

精彩评论

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