Loading ...
Sorry, an error occurred while loading the content.

empty array --> who to define type

Expand Messages
  • ar_munich
    Hi, a webservice expects me to send an empty array (params) represented by the following xml:
    Message 1 of 2 , Sep 20, 2004
    • 0 Attachment
      Hi,

      a webservice expects me to send an empty array (params) represented
      by the following xml:
      <params xsi:type="soapenc:Array" soapenc:arrayType="xsd:string[0]"
      xmlns:ns2="http://www:8081/axis/services/ScriptRunner"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>

      I tried to send an empty array with the following perl code (based on
      soap::lite with wsdl):
      push(@runScriptParameters,SOAP::Data->name("params" => ()) -> type
      ('soapenc:Array' => [])->attr({'soapenc:arrayType' => 'string[0]'}));

      The result is:
      <params soapenc:arrayType="string[0]" xsi:type="soapenc:Array"/>

      So my question is: How can I define the right type of 'params' with
      the right order of xsi:type and soapenc:arrayType ?

      BTW: Is there any resource to get more details how to use SOAP::Data
      to define datatypes?

      Thank you and Best Regards,
      Alexander Reger
      Munich/Germany
    • Steven N. Hirsch
      ... Whether or not there is a way to coerce SOAP::Lite into doing this, you should be aware that the XML specification does not permit or support the notion of
      Message 2 of 2 , Sep 20, 2004
      • 0 Attachment
        On Mon, 20 Sep 2004, ar_munich wrote:

        > Hi,
        >
        > a webservice expects me to send an empty array (params) represented
        > by the following xml:
        > <params xsi:type="soapenc:Array" soapenc:arrayType="xsd:string[0]"
        > xmlns:ns2="http://www:8081/axis/services/ScriptRunner"
        > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
        >
        > I tried to send an empty array with the following perl code (based on
        > soap::lite with wsdl):
        > push(@runScriptParameters,SOAP::Data->name("params" => ()) -> type
        > ('soapenc:Array' => [])->attr({'soapenc:arrayType' => 'string[0]'}));
        >
        > The result is:
        > <params soapenc:arrayType="string[0]" xsi:type="soapenc:Array"/>
        >
        > So my question is: How can I define the right type of 'params' with
        > the right order of xsi:type and soapenc:arrayType ?

        Whether or not there is a way to coerce SOAP::Lite into doing this, you
        should be aware that the XML specification does not permit or support the
        notion of ordered attributes. Any client or server which relies on such
        ordering is fundamentally broken.

        Steve

        --------------------------------------------------------------------
        Opinions expressed in this message are mine personally, not those of
        my employer.
        --------------------------------------------------------------------
      Your message has been successfully submitted and would be delivered to recipients shortly.