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

3055SOM result method yields 0

Expand Messages
  • bjbarleyjuice
    Oct 10, 2003
    • 0 Attachment
      I apologise if wrong but I think I've been through the messages and
      don't find this. I get a response (array of arrays that contain refs)
      envelope that gives no hint of error but seems not to generate
      a 'good' SOM (i.e. $som->result returns 0).

      Looking for clues (and referring to flying dragon pg.333) I try to
      create a SOAP::SOM using the response envelope and get Perl
      error: "Can't use string ("<?xml version="1.0" encoding="UT") as an
      ARRAY ref while "strict refs" in use at c:\perl580
      \site\lib/SOAP/Lite.pm line 376, <XML> line 1".

      I suspect something in the xml is derailing the serializer and this
      isn't related to the ->result (is 0) problem. The latter is what I'm
      really interested in, of course.

      Here's here's the abbreviated (removed lot of 'item's) response
      envelope with a couple of lines of code:
      use SOAP::Lite;

      my $xml = qq(<?xml version="1.0" encoding="UTF-8" ?>
      - <SOAP-ENV:Envelope xmlns:SOAP-
      ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
      - <SOAP-ENV:Body SOAP-
      - <ns1:prodsearch-ack>
      <errorCode xsi:type="xsd:int">0</errorCode>
      <errorMsg xsi:type="xsd:string">Success</errorMsg>
      - <resp xsi:type="ns1:prodsearch-response">
      - <product-desc xsi:type="ns1:product-desc-array">
      - <item xsi:type="ns1:product-desc">
      <priceId xsi:type="xsd:int">0</priceId>
      <roomTypeId xsi:type="xsd:int">0</roomTypeId>
      <productCode xsi:type="xsd:string">RO</productCode>
      <numAvail xsi:type="xsd:int">0</numAvail>
      <numBed xsi:type="xsd:int">0</numBed>
      <maxSleep xsi:type="xsd:int">0</maxSleep>
      <bedDescription xsi:type="xsd:string" />
      <rateName xsi:type="xsd:string">nal Rate</rateName>
      <rateDescription xsi:type="xsd:string" />
      <roomName xsi:type="xsd:string">Bed /Shower Only</roomName>
      <roomDesc xsi:type="xsd:string" />
      <currencyCode xsi:type="xsd:string" />
      <rateChanges href="#_13" />
      <isEstimate href="#_13" />
      <numNight xsi:type="xsd:int">0</numNight>
      <modifyRelative xsi:type="xsd:int">2</modifyRelative>
      <cancelRelative xsi:type="xsd:int">24</cancelRelative>
      <cancellationPolicyDesc xsi:type="xsd:string">Credit card required
      for guarantee. Cancel 24 hours prior to 4 pm (hotel local time) on
      day of arrival.</cancellationPolicyDesc>
      <commissionPolicyType xsi:type="xsd:int">0</commissionPolicyType>
      <commissionPolicyDesc xsi:type="xsd:string" />
      <guaranteePolicyType xsi:type="xsd:int">2</guaranteePolicyType>
      <guaranteePolicyValue xsi:type="xsd:int">0</guaranteePolicyValue>
      <guaranteePolicyDesc xsi:type="xsd:string" />
      <taxPolicyType xsi:type="xsd:int">2</taxPolicyType>
      <taxPolicyDesc xsi:type="xsd:string">0.46 (Euro) Per Room Per Stay,
      not included in total</taxPolicyDesc>
      <taxInd xsi:type="xsd:int">0</taxInd>
      <id id="_13" xsi:type="xsd:boolean">true</id>
      <id id="_26" xsi:type="xsd:boolean">false</id>

      my $som = SOAP::SOM->new($xml);

      #print $som->result;
      print $som->root;
    • Show all 3 messages in this topic