Forum Discussion

jd19211's avatar
jd19211
New Contributor
7 years ago
Solved

How to pass string to array type

Hi,

I have a XML where I need to add parameter in form of string to array.

 

<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:xchg="http://xchg.techdata.cz/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <xchg:getProductsPlusStr soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <request xsi:type="xchg:normalizedStrings" soapenc:arrayType="xsd:normalizedString[]"/>
         <lang xsi:type="xsd:language">CS</lang>
      </xchg:getProductsPlusStr>
   </soapenv:Body>
</soapenv:Envelope>

 

 

What I've done is bellow, but doesn't work. Any suggestion where to put parameters so array can just use them?

 

<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:xchg="http://xchg.techdata.cz/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <xchg:getProductsPlusStr soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <request xsi:type="xchg:normalizedStrings" soapenc:arrayType="xsd:normalizedString[]">AVIMAGE</request>
         <lang xsi:type="xsd:language">CS</lang>
      </xchg:getProductsPlusStr>
   </soapenv:Body>
</soapenv:Envelope>

 

Any help is appreciated.

Thank you

 

  • That's the solution, hope it helps somebody.

     

    <request xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:normalizedString[1]"><item xsi:type="xsd:normalizedString">AVIMAGE</item></request>

1 Reply

  • jd19211's avatar
    jd19211
    New Contributor

    That's the solution, hope it helps somebody.

     

    <request xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:normalizedString[1]"><item xsi:type="xsd:normalizedString">AVIMAGE</item></request>