[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Call to HTTP_URL_P ended in error



Scott, 
      The parser did crash. I have attached the XML file and the StartofElement and EndofElement routines from my program in the CodeSample.txt file

Naresh
 
Naresh Mistry | TM Architect | Nulogx Inc. | 5090 Explorer Dr, Suite 203, Mississauga, ON L4W 4T9 | T: 905-486-1162 x 238 | F: 905-267-3164 | C: 416-820-5231
www.nulogx.com | Transportation Management Solutions | www.cgfi.ca | Canadian General Freight Index – Register Today



-----Original Message-----
From: Scott Klement [mailto:sk@xxxxxxxxxxxxxxxx] 
Sent: Monday, May 14, 2012 10:06 AM
To: Naresh Mistry
Cc: HTTPAPI and FTPAPI Projects
Subject: Re: Call to HTTP_URL_P ended in error

Hi Naresh,

rc=1 means success.

The http_url_post() routine does not parse the data you receive back from the server, it simply saves it to a file.  So nothing "replaces" 
the StartOfElement/EndOfElement -- the XML parser hasn't been run, so there's nothing similar to those.

What we have determined, therefore, is that the error isn't occurring during the HTTP communications. It's occuring during the XML parsing.

Now your XML file is in a stream file (maybe called /tmp/httpapi_test.txt -- or whatever you decided to call it.)

Let's try parsing that XML without doing the HTTP transfer:

rc = http_parse_xml_stmf( '/tmp/httpapi_test.xml'
                         : HTTP_XML_CALC
                         : %paddr(StartOfElement)
                         : %paddr(EndOfElement)
                         : *null );

So this takes the file you've already downloaded and parses it directly from the IFS without the network communications happening.  Since we now suppose the error is occurring during XML processing, I can only assume that this will end in error (call to HTTP_PARSE ended in error).

Please try that, and see if it's true.   If I'm right and it crashes, 
please send me the XML file and the two routines
(StartOfElement/EndOfElement) so I can try to reproduce the problem on my box.

-SK

On 5/14/2012 7:30 AM, Naresh Mistry wrote:
>
> Scott, I made the change, nothing crashed and rc returned a 1. Now 
> that StartofElement and EndofElement procedures are not part of the 
> parameter list, what replaces these procedures ?
>
> Naresh >
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soap:Body><ns1:LTLRateShipmentResponse xmlns:ns1="http://webservices.smc.com";><ns1:LTLRateShipmentResponse><LHGrossCharge xmlns="http://web.ltl.smc.com";>0</LHGrossCharge><LTL_Surcharge xmlns="http://web.ltl.smc.com";></LTL_Surcharge><RBNO xmlns="http://web.ltl.smc.com";></RBNO><TL_Surcharge xmlns="http://web.ltl.smc.com";></TL_Surcharge><absoluteMCFloor xmlns="http://web.ltl.smc.com";>0</absoluteMCFloor><actualWgt xmlns="http://web.ltl.smc.com";>0</actualWgt><billedWgt xmlns="http://web.ltl.smc.com";>0</billedWgt><deficitCharge xmlns="http://web.ltl.smc.com";>0</deficitCharge><deficitRate xmlns="http://web.ltl.smc.com";>0</deficitRate><deficitWeight xmlns="http://web.ltl.smc.com";>0</deficitWeight><destinationCity xmlns="http://web.ltl.smc.com";></destinationCity><destinationCountry xmlns="http://web.ltl.smc.com";>US</destinationCountry><destinationPostalCode xmlns="http://web.ltl.smc.com";>40111</destinationPostalCode><destinationState xmlns="http://web.ltl.smc.com";></destinationState><details xmlns="http://web.ltl.smc.com";><LTLResponseDetail><charge></charge><error>0</error><nmfcClass>65</nmfcClass><rate></rate><weight>498.0000</weight></LTLResponseDetail></details><discountAmount xmlns="http://web.ltl.smc.com";>0</discountAmount><discountApplication xmlns="http://web.ltl.smc.com";>C</discountApplication><discountPctUsed xmlns="http://web.ltl.smc.com";>0</discountPctUsed><effectiveDate xmlns="http://web.ltl.smc.com";></effectiveDate><errorCode xmlns="http://web.ltl.smc.com";>28</errorCode><mcDiscount xmlns="http://web.ltl.smc.com";>60</mcDiscount><minimumCharge xmlns="http://web.ltl.smc.com";>0</minimumCharge><orgDestToGateWayPointFlag xmlns="http://web.ltl.smc.com";></orgDestToGateWayPointFlag><originCity xmlns="http://web.ltl.smc.com";></originCity><originCountry xmlns="http://web.ltl.smc.com";>US</originCountry><originPostalCode xmlns="http://web.ltl.smc.com";>30344</originPostalCode><originState xmlns="http://web.ltl.smc.com";></originState><rateAdjustmentFactor xmlns="http://web.ltl.smc.com";>1.0</rateAdjustmentFactor><rateApplication xmlns="http://web.ltl.smc.com";></rateApplication><shipmentDateCCYYMMDD xmlns="http://web.ltl.smc.com";>20110110</shipmentDateCCYYMMDD><shipmentID xmlns="http://web.ltl.smc.com";></shipmentID><stopAlternationWeight xmlns="http://web.ltl.smc.com";></stopAlternationWeight><suffix xmlns="http://web.ltl.smc.com";></suffix><surchargeAmount xmlns="http://web.ltl.smc.com";>0</surchargeAmount><surchargeApplication xmlns="http://web.ltl.smc.com";>N</surchargeApplication><surchargePercentUsed xmlns="http://web.ltl.smc.com";>0</surchargePercentUsed><tariffName xmlns="http://web.ltl.smc.com";>DEMOLTLA</tariffName><tblno xmlns="http://web.ltl.smc.com";></tblno><totalCharge xmlns="http://web.ltl.smc.com";>0</totalCharge><useDiscounts xmlns="http://web.ltl.smc.com";>Y</useDiscounts><useSingleShipmentCharges xmlns="http://web.ltl.smc.com";>N</useSingleShipmentCharges><userMinimumChargeFloor xmlns="http://web.ltl.smc.com";></userMinimumChargeFloor><weightBreak_Discount_1 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_1><weightBreak_Discount_10 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_10><weightBreak_Discount_11 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_11><weightBreak_Discount_2 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_2><weightBreak_Discount_3 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_3><weightBreak_Discount_4 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_4><weightBreak_Discount_5 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_5><weightBreak_Discount_6 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_6><weightBreak_Discount_7 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_7><weightBreak_Discount_8 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_8><weightBreak_Discount_9 xmlns="http://web.ltl.smc.com";></weightBreak_Discount_9></ns1:LTLRateShipmentResponse></ns1:LTLRateShipmentResponse></soap:Body></soap:Envelope>
ÿþ  10100       * ---------------------------------------------------------------                                         04/07/11

  10200       *           Prototype definiton for StartOfElement Procedure                                              04/07/11

  10300       * ---------------------------------------------------------------                                         04/07/11

  10400      D StartOfElement  PR                                                                                       09/23/06

  10500      D   UserData                      *   value                                                                09/23/06

  10600      D   depth                       10I 0 value                                                                09/23/06

  10700      D   name                      1024A   varying const                                                        09/23/06

  10800      D   path                     24576A   varying const                                                        09/23/06

  10900      D   attrs                         *   dim(32767)                                                           09/23/06

  11000      D                                     const options(*varsize)                                              09/23/06

  11100       * ---------------------------------------------------------------                                         04/07/11

  11200       *           Prototype definiton for EndOfElement Procedure                                                04/07/11

  11300       * ---------------------------------------------------------------                                         04/07/11

  11400      D EndOfElement    PR                                                                                       09/23/06

  11500      D   UserData                      *   value                                                                09/23/06

  11600      D   depth                       10I 0 value                                                                09/23/06

  11700      D   name                      1024A   varying const                                                        09/23/06

  11800      D   path                     24576A   varying const                                                        09/23/06

  11900      D   value                    65535A   varying const                                                        09/12/07

  12000      D   attrs                         *   dim(32767)                                                           09/23/06

  12100      D                                     const options(*varsize)                                              09/23/06

  12200       * ---------------------------------------------------------------                                         04/07/11

  

  15300      D path1           s            500A                                                                        05/01/12

  15400      D path2           s            500A                                                                        05/01/12

  15500      D path3           s            500A                                                                        05/02/12

  

  20300                                                                                                                 05/04/12

  20400          // Set Paths                                                                                           05/04/12

  20500          path1 = '/soap:Envelope/soap:Body/'                      +                                             05/01/12

  20600                 'ns1:LTLRateShipmentResponse/'                    +                                             05/01/12

  20700                 'ns1:LTLRateShipmentResponse';                                                                  05/02/12

  20800                                                                                                                 05/01/12

  20900          path2 = '/soap:Envelope/soap:Body/'                      +                                             05/02/12

  21000                 'ns1:LTLRateShipmentResponse/'                    +                                             05/02/12

  21100                 'ns1:LTLRateShipmentResponse/'                    +                                             05/02/12

  21200                 'details';                                                                                      05/02/12

  21300                                                                                                                 05/02/12

  21400          path3 = '/soap:Envelope/soap:Body/'                      +                                             05/02/12

  21500                 'ns1:LTLRateShipmentResponse/'                    +                                             05/01/12

  21600                 'ns1:LTLRateShipmentResponse/'                    +                                             05/01/12

  21700                 'details/LTLResponseDetail';                                                                    05/02/12

  21800                                                                                                                 05/04/12

                                                            02/25/11

  42800         //-----------------------------------------------------------//                                         04/07/11

  42900         //           Procedures - Start of Element                   //                                         04/07/11

  43000         //-----------------------------------------------------------//                                         04/07/11

  43100                                                                                                                 09/23/06

  43200      P StartOfElement  B                                                                                        09/23/06

  43300      D StartOfElement  PI                                                                                       09/23/06

  43400      D   UserData                      *   value                                                                09/23/06

  43500      D   depth                       10I 0 value                                                                09/23/06

  43600      D   name                      1024A   varying const                                                        09/23/06

  43700      D   path                     24576A   varying const                                                        09/23/06

  43800      D   attrs                         *   dim(32767)                                                           09/23/06

  43900      D                                     const options(*varsize)                                              09/23/06

  44000       /free                                                                                                     09/23/06

  44100                                                                                                                 09/23/06

  44200        //*------------------------------------------------------------*                                         04/07/11

  44300        //   Path for Freight Classes                                                                            05/01/12

  44400        //*------------------------------------------------------------*                                         04/07/11

  44500                                                                                                                 04/07/11

  44600           Select;                                                                                               04/07/11

  44700           When path = path2 and name = 'LTLResponseDetail';                                                     05/01/12

  44800             //  @Count = @Count + 1;                                                                              05/04/12

  44900           EndSl;                                                                                                04/07/11

  45000                                                                                                                 03/26/12

  45100       /end-free                                                                                                 09/23/06

  45200      P                 E                                                                                        09/23/06

  45300                                                                                                                 09/23/06

  45400         //-----------------------------------------------------------//                                         04/07/11

  45500         //           Procedures - End of Element                     //                                         04/07/11

  45600         //-----------------------------------------------------------//                                         04/07/11

  45700                                                                                                                 09/23/06

  45800      P EndOfElement    B                                                                                        09/23/06

  45900      D EndOfElement    PI                                                                                       09/23/06

  46000      D   UserData                      *   value                                                                09/23/06

  46100      D   depth                       10I 0 value                                                                09/23/06

  46200      D   name                      1024A   varying const                                                        09/23/06

  46300      D   path                     24576A   varying const                                                        09/23/06

  46400      D   value                    65535A   varying const                                                        09/12/07

  46500      D   attrs                         *   dim(32767)                                                           09/23/06

  46600      D                                     const options(*varsize)                                              09/23/06

  46700       /free                                                                                                     09/23/06

  46800                                                                                                                 02/25/11

  46900                                                                                                                 04/07/11

  47000        //*------------------------------------------------------------*                                         04/07/11

  47100        //              Path for SUCCESS!!!                                                                      04/07/11

  47200        //*------------------------------------------------------------*                                         04/07/11

  47300                                                                                                                 04/07/11

  47400        //Error Checking                                                                                         05/01/12

  47500        //--------------------------------------------------------------                                         04/07/11

  47600                                                                                                                 04/07/11

  47700           select;                                                                                               05/01/12

  47900           when path = path1;                                                                                    05/01/12

  48000           // Deficit Details                                                                                    05/01/12

  48100              select;                                                                                            05/01/12

  48200              when name = 'deficitCharge';                                                                       05/01/12

  48300                 //  rxdchg = %dec(%trim(value):11:2);                                                             05/01/12

  48400              when name = 'deficitRate';                                                                         05/01/12

  48500                 //  rxdrte = %dec(%trim(value):7:2);                                                              05/01/12

  48600               when name = 'deficitWeight';                                                                      05/02/12

  48700                 //  rxdwgt = %dec(%trim(value):11:4);                                                             05/02/12

  48800               when name = 'RBNO';                                                                               05/03/12

  48900                 //  p0Rat = %subst(value:3:6);                                                                    05/03/12

  49000              endsl;                                                                                             05/01/12

  49100                                                                                                                 05/01/12

  49200           // Freight Classes                                                                                    05/01/12

  49300           when path = path3;                                                                                    05/02/12

  49400              select;                                                                                            05/01/12

  49500              when name = 'charge';                                                                              05/01/12

  49600                 //  frtClasses.pAmount(@Count) = %dec(%trim(value):11:2);                                         05/04/12

  49700              when name = 'rate';                                                                                05/01/12

  49800                 //  frtClasses.pRate(@Count) = %dec(%trim(value):7:2);                                            05/04/12

  49900              endsl;                                                                                             05/01/12

  50000                                                                                                                 05/01/12

  50100           endSl;                                                                                                05/01/12

  50200                                                                                                                 04/07/11

  50300       /end-free                                                                                                 09/23/06

  50400      P                 E                                                                                        09/23/06

                                  * * * *  E N D  O F  S O U R C E  * * * *

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------