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

Null array help

Expand Messages
  • Pedro Timóteo
    Hi. First message here from me. :) I m using this code: $quatro=SOAP::Data- name( contactList = [SOAP::Data- type(int = undef)]); which generates:
    Message 1 of 2 , Oct 15, 2004
    • 0 Attachment
      Hi. First message here from me. :)

      I'm using this code:

      $quatro=SOAP::Data->name('contactList' =>[SOAP::Data->type(int => undef)]);

      which generates:

      <contactList xsi:type="SOAP-ENC:Array"
      SOAP-ENC:arrayType="xsd:int[1]"><item xsi:type="xsd:int"
      xsi:null="1"/></contactList>

      that is, an array of integers with a null item.

      However, what I want is something like this:

      <contactList xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[]"
      xsi:null="1"/>

      in other words, a null array, an array without any items.

      How can I do that?

      Thanks,

      --
      Pedro Timóteo <patimoteo@...>
      Systems Management & Internetworking Specialist
      DTI - ext. 5682
      PGA - Portugália Airlines
    • Duncan Cameron
      ... Either of these give you nearly but not quite what you are looking for $data=SOAP::Data - name( contactList = []) - attr({ xsi:null = 1});
      Message 2 of 2 , Oct 16, 2004
      • 0 Attachment
        On 2004-10-15 at 13:16:32 Pedro_Timóteo wrote:

        >Hi. First message here from me. :)
        >
        >I'm using this code:
        >
        >$quatro=SOAP::Data->name('contactList' =>[SOAP::Data->type(int =>
        >undef)]);
        >
        >which generates:
        >
        ><contactList xsi:type="SOAP-ENC:Array"
        >SOAP-ENC:arrayType="xsd:int[1]"><item xsi:type="xsd:int"
        >xsi:null="1"/></contactList>
        >
        >that is, an array of integers with a null item.
        >
        >However, what I want is something like this:
        >
        ><contactList xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[]"
        >xsi:null="1"/>
        >
        >in other words, a null array, an array without any items.
        >
        >How can I do that?

        Either of these give you nearly but not quite what you are looking for

        $data=SOAP::Data
        ->name('contactList' => [])
        ->attr({'xsi:null' => 1});

        $data=SOAP::Data
        ->name('contactList' => undef)
        ->type('SOAP-ENC:Array');

        Regards
        Duncan
      Your message has been successfully submitted and would be delivered to recipients shortly.