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

2771Re:

Expand Messages
  • jpeyser
    Jul 2, 2003
    • 0 Attachment
      Mark,

      Here is one way to do it.

      my $service_accounts = [ SOAP::Data->name(account =>
      \SOAP::Data->value(
      SOAP::Data->name(UserId => 'ABC'),
      SOAP::Data->name(UserId => 'ABC'),
      )
      )];

      return SOAP::Data->name("AccountList" => $service_accounts)->type
      ("xsd:ArrayOfAccounts");

      See following article by byrne reese
      http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread

      Jonathan

      --- In soaplite@yahoogroups.com, "mscance" <mark@f...> wrote:
      > Hi,
      >
      > I'm returning an array like so;
      > return SOAP::Data->name("AccountList")->type("xsd:ArrayOfAccounts"
      =>
      > \@services_accounts);
      >
      > Where @services_accounts is an array of hashes of the format;
      > UserId => ABC
      >
      > My code all works and i get the following returned;
      > <AccountList SOAP-ENC:arrayType="namesp2:SOAPStruct[5]"
      > xsi:type="xsd:ArrayOfAccounts">
      > <item xsi:type="namesp2:SOAPStruct">
      > <UserId xsi:type="xsd:string">ABC</UserId>
      > </item>
      > </AccountList>
      >
      > My problem is that I want the return to be;
      > <AccountList SOAP-ENC:arrayType="namesp2:SOAPStruct[5]"
      > xsi:type="xsd:ArrayOfAccounts">
      > <account xsi:type="xsd:User">
      > <UserId xsi:type="xsd:string">ABC</UserId>
      > </account>
      > </AccountList>
      >
      > Anyone have any ideas on how I could change the <item> to something
      > more meaningful and declare the type without hacking
      SOAP::Serializer??
      >
      > Also the SOAP-ENC:arrayType="namesp2:SOAPStruct[5]" worries me its
      the
      > size of the array but the namespace looks weird...
      >
      > As always any help really appreciated,
      > Best
      > Mark.
    • Show all 5 messages in this topic