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

Re: [soaplite] Complex types help

Expand Messages
  • rahed
    ... Try this, it should generate exactly the same structure. $SOAP::Constants::PREFIX_ENC = SOAP-ENC ; @data = ( [ modified_by_name , admin ], );
    Message 1 of 2 , Mar 19, 2009
    • 0 Attachment
      "malcolmpdx" <malcolmpdx@...> writes:

      > I have hit a real block. The eventual output I need to have sent looks like this:
      >
      > <name_value_list xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:name_value[1]">
      > <item xsi:type="tns:name_value">
      > <name xsi:type="xsd:string">modified_by_name</name>
      > <value xsi:type="xsd:string">admin</value>
      > </item>
      > </name_value_list>

      Try this, it should generate exactly the same structure.


      $SOAP::Constants::PREFIX_ENC = 'SOAP-ENC';

      @data = (
      ['modified_by_name','admin'],
      );
      $soap->serializer->register_ns('http://my.namespace1'=>'xmlns:tns');

      for my $item (@data) {
      push @name_value, SOAP::Data->name('item')->type('tns:name_value'=>\SOAP::Data->value(
      SOAP::Data->name(name => $item->[0])->type('string'),
      SOAP::Data->name(value => $item->[1])->type('string'),
      ),
      );
      }

      And object to send:

      $object = SOAP::Data->name('name_value_list')->type('SOAP-ENC:Array'=>\@name_value);

      hth

      --
      Radek
    Your message has been successfully submitted and would be delivered to recipients shortly.