Based on your comment I've started to investigate why server side doesn't handle arrays. I've checked code in your SOAP.pm. I've focused only to get_usertag method, which it handle or will be handle one or three parameters:
my %ut = get_usertag('don@donarmstrong.com','this-bug-sucks','eat-this-bug');
my %ut = get_usertag('don@donarmstrong.com');
I think your goal is make a request which accepts a variable number of types as parameters. Previously, I offered to you use one compound type (complexType) in parameter, which it has many or zero parameters.
Now I check SOAP::Lite documentation which it say:
- No support for multidimensional, partially transmitted and sparse arrays (however arrays of arrays are supported, as well as any other data structures, and you can add your own implementation with SOAP::Data).
- Limited support for WSDL schema.
So, the simple array and SOAP::Data are supported. Technically it is possible to send and handle array (second limitation is awful news for me). But I can imagine another reason (another client use this method...) for not supporting array. Please check also differences between a SOAP::WSDL and SOAP::Lite.
I thinking about many options how to send many parameters, but for each options are need to change server-side code. Perhaps can you do some hacks/magic to resolve this issue (use one parameter which contained all parameters and splited in server-side), but I think simple SOAP::Data is better option.
I doesn't change WSDL structure. You can use my bellow code. Please change server-side code in get_usertag method (I haven't seen perl code before, I cannot wrote this code). That method declare two fields $email
and @tags
. Please change to $email
and $tag_list
. The $tag_list
containts @tags
arrays.
Based on your WSDL I created simply WSDL. It containt only two operation, message and only one schema. This shema use your namespace. So it doesn't need to specify another namespace. Here is relevant part from WSDL:
<wsdl:types>
<xsd:schema targetNamespace="urn:Debbugs/SOAP" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="get_usertagResponse" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!--The new Tag_lis element-->
<xsd:element name="Tag_list" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="tag" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<!--get_usertagRequest use Tag_lis element-->
<wsdl:message name="get_usertagRequest">
<wsdl:part name="email" type="xsd:string"/>
<wsdl:part name="tag_list" element="tns:Tag_list"/>
</wsdl:message>
<wsdl:message name="get_usertagResponse">
<wsdl:part name="msg" type="tns:get_usertagResponse"/>
</wsdl:message>
I think you can implement this part to your WSDL. If it possible, please merge schemas. This code works, I tested it in soapUi. I get following request:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="urn:Debbugs/SOAP">
<soapenv:Header/>
<soapenv:Body>
<soap:get_usertag soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<email xsi:type="xsd:string">?</email>
<soap:Tag_list>
<!--Zero or more repetitions:-->
<tag xsi:type="xsd:string">?</tag>
</soap:Tag_list>
</soap:get_usertag>
</soapenv:Body>
</soapenv:Envelope>
In this case client send these parameters:
client = Client(url)
service = client.service['debian.org']
foo = service.get_usertag('someone@debian.org', tag_list=['malloc', 'amother'])