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

647Re: Help needed: sending complex structures

Expand Messages
  • adrian@cheerful.com
    Jul 17 2:09 PM
    • 0 Attachment
      Hi Paul,

      Thanks! That worked perfectly. I have came across a second
      problem, however, can you please advise on what I should do? I have
      called a web service, and by a tunneling application I can see that
      I get the results back, but when I call:
      $s->WebService($var1);
      Perl terminates, with the error message being the result of the Web
      Service. The Web Service returns a rather complex structure:

      <types:DetailedQuote id="id2" xsi:type="types:DetailedQuote">
      <Symbol xsi:type="xsd:string">string</Symbol>
      <CompanyName xsi:type="xsd:string">string</CompanyName>
      <LastPrice xsi:type="xsd:decimal">decimal</LastPrice>
      <LastPriceTime xsi:type="xsd:dateTime">dateTime</LastPriceTime>
      ...
      <Exchange xsi:type="types:Exchanges"> one of NASDAQ or NYSE or
      AMEX or INDEX</Exchange>

      I have a similar service that doesn't have the Exchange value, and
      have fewer return values, and that worked perfectly. I suspect the
      xsi:type="types:Exchanges" have something to do with it.

      I get the return value by:
      my @struct = @{$s->WebService($var1)->result};
      $symbol = $struct[0]->{Symbol};
      but the problem is the program stops at $s->WebService($var1)
      because it can't deserialize the result. If I use the other
      service, WebService2, the above code works fine.

      Any suggestions?

      Adrian


      --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
      > Hi, Adrian!
      >
      > > > %header=('Key',"$key",'Type',"$type");
      > > > @symbols=($symbol, "IBM");
      > > > $var1 = SOAP::Data->type(boolean => false)->name('realtime');
      > > > $var2 = SOAP::Data->type(array => @symbols)->name('Array');
      > > > my $a = $s -> GetSimpleQuote($var1, $var2,SOAP::Header->name
      > > > ('AuthenticationHeader' => %header));
      > %header should be hashref, not hash:
      >
      > > > SOAP::Header->name('AuthenticationHeader' => %header);
      > either:
      >
      > SOAP::Header->name('AuthenticationHeader' => \%header);
      >
      > or
      >
      > $header = {Key => $key, Type => $type};
      > SOAP::Header->name('AuthenticationHeader' => $header);
      >
      > Hope it helps.
      >
      > Best wishes, Paul.
    • Show all 10 messages in this topic