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

Are arrays of complexTypes supported in SOAP::LITE

Expand Messages
  • blakebatsnap
    Is it possible to get this kind of serialization from SOAP::LITE:
    Message 1 of 1 , Oct 18, 2002
    View Source
    • 0 Attachment
      Is it possible to get this kind of serialization
      from SOAP::LITE:

      <userAccount xsi:type="ns1:UserAccount">
      <accountName xsi:type="xsd:string">johnd</accountName>
      <emailAddresses xsi:type="SOAP-ENC:Array" SOAP-
      ENC:arrayType="ns1:EmailAddress[2]">
      <item>
      <email xsi:type="xsd:string">john@...</email>
      <formatId xsi:type="xsd:string">HTML</formatId>
      </item>
      <email xsi:type="xsd:string">john@...</email>
      <formatId xsi:type="xsd:string">WML</formatId>
      </item>
      </emailAddresses>
      </userAccount>

      In particular, I can't seem to get the array encoded properly.
      I keep getting it converting to a Map when I use code like
      this:

      my $email1 = SOAP::Data->type('EmailAddress' => [
      SOAP::Data->name('email' => 'test@...'),
      SOAP::Data->name('formatId' => 'HTML')]);
      my $email2 = SOAP::Data->type('EmailAddress' => [
      SOAP::Data->name('email' => 'test2@...'),
      SOAP::Data->name('formatId' => 'WML')]);
      my $emails = {$email1, $email2};
      my $userAccount = {
      'accountName' => 'johnd',
      'emailAddresses' => $emails,
      };


      my $result = $service->createAccount($userAccount);

      Hopefully, I'm just missing something obvious.

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