[Fedora-suds-list] Force the datatype of a parameter

Frédéric Junod frederic.junod at camptocamp.com
Wed Jul 30 07:57:43 UTC 2008


Hi all,

I use a WSDL [1] that declare a "ArrayOfAnyType" complex type:
<s:complexType name="ArrayOfAnyType">
  <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded" name="anyType"
               nillable="true"/>
  </s:sequence>
</s:complexType>

And I can easily create instances of this with:
  ...
  param = client.factory.create('ArrayOfAnyType')
  param.anyType = ["hello", "world"]

But when I call a remote function, the following envelope is send:
<SOAP-ENV:Envelope ...> 
  <SOAP-ENV:Header>
  ...
  </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <tns:GetStep>
         <tns:localisationName>Adresse</tns:localisationName>
         <tns:index>1</tns:index>
         <tns:params>
            <tns:anyType>hello</tns:anyType>
            <tns:anyType>world</tns:anyType>
         </tns:params>
      </tns:GetStep>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is perfectly correct but I need that each of the "anyType" parameter have
the "xsd:string" type set. Something like:
...
<tns:params>
  <tns:anyType xsi:type="xsd:string">hello</tns:anyType>
  <tns:anyType xsi:type="xsd:string">world</tns:anyType>
</tns:params>
...

Is there a way to do that ?

Regards,

fredj

PS: I use the svn version

[1] http://etat.geneve.ch/geoportail/localisationws/localisations.wsdl

-- 
Frédéric Junod
Camptocamp SA




More information about the fedora-suds-list mailing list