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

RE: HTTP_URL_POST_RAW "Recvresp(): entered" then "Recvresp(): end with err" and not returned to 'INCOMING'



In the debug, you appear to have cut the size of the incoming data out. But my guess, is that it exceeds the size of retData which caused an exception in Incoming which was reflected as a problem in recvresp.

Make retdata huge and see if your problem clears or compare the size of the incoming data to your variable and make sure you have enough room.


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Todd Carmosino
Sent: Wednesday, May 15, 2013 3:52 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: HTTP_URL_POST_RAW "Recvresp(): entered" then "Recvresp(): end with err" and not returned to 'INCOMING'

Hello All,

Looked over the FTPAPI archive, but "No Joy" for a solution to this
problem ...

Based on the [http_debug_file] below, it appears that the server
successfully accepted and processed my http_url_post_raw XML request,
but the [Code Snippet] even more below, receives an error - *recvresp():
end with err. **
**
*I want to simply return the XML response back to the calling COBOL
program and have it perform the parse.

Thanks in advance...

Todd Carmosino

----------------------------------
[http_debug_file]
----------------------------------
HTTPAPI Ver 1.24 released 2012-01-23
OS/400 Ver V6R1M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
WMS Environment: WMSPRD
DHL EasyShip: 5.0.110.62:2077
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 10
DNS resolver retry  : 5
DNS resolver options: x'00000136'
DNS default domain: BTOL.COM
DNS server found: 5.0.112.158
DNS server found: 5.0.112.156
http_persist_post(): entered
http_persist_req(POST) entered.
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST / HTTP/1.1
Host: 5.0.110.62:2077
User-Agent: http-api/1.24
Content-Type: application/xml;charset=UTF-8
Content-Length: 4342


senddoc(): entered
xml=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%3Creq%3ARateRouteRequest+xmlns%3Areq%3D%22http%3A%2F%2Fwww.dhl.com%22%3E%3CRequest%3E%3CServiceHeader%3E%3CMessageReference%3E813040%3C%2FMessageReference%3E%3C%2FServiceHeader%3E%3C%2FRequest%3E%3CMessageVersion%3E2%3C%2FMessageVersion%3E%3CShipment%3E%3CBilling%3E%3CShippingPaymentType%3ES%3C%2FShippingPaymentType%3E%3C%2FBilling%3E%3CConsignee%3E%3CCity%3EGEELONG%3C%2FCity%3E%3CPostalCode%3E3220%3C%2FPostalCode%3E%3CCountryCode%3EAU%3C%2FCountryCode%3E%3C%2FConsignee%3E%3CShipmentDetails%3E%3CNumberOfPieces%3E1%3C%2FNumberOfPieces%3E%3CWeight%3E5.6%3C%2FWeight%3E%3CDate%3E2013-05-15%3C%2FDate%3E%3CContents%3ERate+Route+Request%3C%2FContents%3E%3CProductCodeSwiftShip%3E101%3C%2FProductCodeSwiftShip%3E%3C%2FShipmentDetails%3E%3CShipper%3E%3CShipperID%3EPrimary%3C%2FShipperID%3E%3C%2FShipper%3E%3C%2FShipment%3E%3C%2Freq%3ARateRouteRequest%3E%0D%0A+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
recvresp(): entered
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:RateRouteResponse xmlns:ns2="http://www.dhl.com";
xmlns:ns4="http://www.dhl.com/datatypesSwiftShip";
xmlns:ns3="http://www.dhl.com/datatypesSwiftShipSDK";
xmlns:ns5="http://www.dhl.com/datatypes";>
     <Response>
         <ServiceHeader>
<MessageTime>2013-05-15T15:45:18.049-04:00</MessageTime>
             <MessageReference>813040</MessageReference>
         </ServiceHeader>
     </Response>
     <MessageVersion>2</MessageVersion>
     <Status>
         <Code>0</Code>
         <Message></Message>
     </Status>
     <ExecutionTimeInMillis>31</ExecutionTimeInMillis>
     <Shipment>
         <Billing>
<ShipperAccountNumber>850939956</ShipperAccountNumber>
             <ShippingPaymentType>S</ShippingPaymentType>
         </Billing>
         <Consignee>
             <CompanyName></CompanyName>
             <City>GEELONG</City>
             <PostalCode>3220</PostalCode>
             <CountryCode>AU</CountryCode>
             <Contact/>
<SendEmailNotification>false</SendEmailNotification>
         </Consignee>
         <Dutiable>
             <DeclaredValue>0.00</DeclaredValue>
         </Dutiable>
         <ExportDeclaration>
             <IsPartiesRelation>false</IsPartiesRelation>
<IsRoutedExportTransaction>false</IsRoutedExportTransaction>
<IsLicensableCanadianShipment>false</IsLicensableCanadianShipment>
             <AESOption>0</AESOption>
<IsDepartmentOfStateShipment>false</IsDepartmentOfStateShipment>
<IsDepartmentOfStateExempt>false</IsDepartmentOfStateExempt>
             <Importer>
                 <Contact/>
             </Importer>
         </ExportDeclaration>
         <ShipmentDetails>
             <NumberOfPieces>1</NumberOfPieces>
             <Pieces>
                 <Piece>
<PieceID>1368647118018100068</PieceID>
                     <Weight>5.6</Weight>
                     <Contents>Rate Route Request</Contents>
                     <Contents></Contents>
                     <Contents></Contents>
                     <Reference>
<ReferenceID>1368647118018100068</ReferenceID>
                     </Reference>
                     <InsuredAmount>0.00</InsuredAmount>
                     <CODAmount>0.00</CODAmount>
<PackageCharge>137.35</PackageCharge>
<BookPackageCharge>0.00</BookPackageCharge>
<ShippingCharge>157.27</ShippingCharge>
                     <DryIceWeight>0.0</DryIceWeight>
                     <DryIceWeightUOM>L</DryIceWeightUOM>
                 </Piece>
             </Pieces>
             <Weight>5.6</Weight>
             <ChargeableWeight>6.0</ChargeableWeight>
             <WeightUnit>L</WeightUnit>
             <Date>2013-05-15</Date>
             <Contents>Rate Route Request</Contents>
             <Contents></Contents>
             <Contents></Contents>
             <DimensionUnit>C</DimensionUnit>
             <InsuredAmount>0.00</InsuredAmount>
<ProductCodeSwiftShip>101</ProductCodeSwiftShip>
         </ShipmentDetails>
         <Shipper>
             <ShipperID>Primary</ShipperID>
             <CompanyName>BAKER &amp; TAYLOR INC</CompanyName>
<RegisteredAccount>850939956</RegisteredAccount>
             <AddressLine>1120 US HIGHWAY ROUTE 22 E</AddressLine>
             <City>BRIDGEWATER</City>
             <DivisionCode>NJ</DivisionCode>
             <PostalCode>08807</PostalCode>
             <CountryCode>US</CountryCode>
             <Contact>
                 <PersonName>ROBERT WALSH</PersonName>
                 <PhoneNumber>908-541-7055</PhoneNumber>
                 <FaxNumber>908-541-7859</FaxNumber>
             </Contact>
         </Shipper>
         <Service>
             <ServiceType>512</ServiceType>
             <ChargeValue>19.92</ChargeValue>
             <BookChargeValue>0.00</BookChargeValue>
             <CurrencyCode>USD</CurrencyCode>
         </Service>
         <CommercialInvoice>
             <InsuranceCharges>0.00</InsuranceCharges>
             <OtherCharges>0.00</OtherCharges>
         </CommercialInvoice>
         <Attributes/>
         <OriginServiceArea>
             <ServiceAreaCode>TTN</ServiceAreaCode>
         </OriginServiceArea>
         <DestinationServiceArea>
             <ServiceAreaCode>MBW</ServiceAreaCode>
         </DestinationServiceArea>
         <DestinationUSPSFacility>
             <FacilityName></FacilityName>
             <AddressLine></AddressLine>
             <AddressLine></AddressLine>
             <City></City>
             <State></State>
             <PostalCode></PostalCode>
         </DestinationUSPSFacility>
         <PackageCharge>137.35</PackageCharge>
         <BookPackageCharge>0.00</BookPackageCharge>
         <ShippingCharge>157.27</ShippingCharge>
         <BookShippingCharge>0.00</BookShippingCharge>
         <WeightUnit>L</WeightUnit>
         <DimensionalWeight>0</DimensionalWeight>
<MessageReplyStatus>DoNotSend</MessageReplyStatus>
         <StoredIn>SwiftShipDatabase</StoredIn>
         <DataEntrySource>unknown</DataEntrySource>
         <Status>RatedRouted</Status>
         <CODAmount>0</CODAmount>
         <LabelRoutingField1></LabelRoutingField1>
         <LabelRoutingField2></LabelRoutingField2>
         <LabelRoutingField3></LabelRoutingField3>
         <MiscLabelFields>
             <LabelRoutingField1></LabelRoutingField1>
             <LabelRoutingField2></LabelRoutingField2>
             <LabelRoutingField3></LabelRoutingField3>
<LabelServiceContentCode>DOX</LabelServiceContentCode>
<LabelServiceContentFormat>0</LabelServiceContentFormat>
<ValueAddedServiceBar></ValueAddedServiceBar>
<TimeDayDefiniteLabel></TimeDayDefiniteLabel>
<TimeDayDefiniteField></TimeDayDefiniteField>
<RoutingBarcodeScannable>2LAU3220+42000000</RoutingBarcodeScannable>
<RoutingBarcodeReadable>(2L)AU3220+42000000</RoutingBarcodeReadable>
<WaybillBarcodeScannable></WaybillBarcodeScannable>
<WaybillBarcodeReadable></WaybillBarcodeReadable>
<InternationalServiceString>null</InternationalServiceString>
             <SEDString></SEDString>
             <CustomsValueString>NVD</CustomsValueString>
<ExportLicenseSymbolString></ExportLicenseSymbolString>
<TransportCollectNumber></TransportCollectNumber>
             <DHLFacilityCode>MGB</DHLFacilityCode>
             <ProductName>EXPRESS WORLDWIDE</ProductName>
             <OutboundSort></OutboundSort>
             <InboundSort></InboundSort>
             <DeliveryDayCode></DeliveryDayCode>
             <DeliveryTimeCode></DeliveryTimeCode>
<LabelNetworkServiceCode>D</LabelNetworkServiceCode>
             <PaymentCode>null</PaymentCode>
             <FreightString></FreightString>
             <ServiceString>null</ServiceString>
         </MiscLabelFields>
         <Uploaded>false</Uploaded>
         <PassThroughCharge>
             <ServiceSasCode>101</ServiceSasCode>
             <BaseAmount>137.35</BaseAmount>
<PassThroughChargeAmount>0</PassThroughChargeAmount>
<PassThroughAdditionalChargeAmount>0</PassThroughAdditionalChargeAmount>
<TotalPassThroughChargeAmount>137.35</TotalPassThroughChargeAmount>
         </PassThroughCharge>
         <PassThroughCharge>
             <ServiceSasCode>101</ServiceSasCode>
             <VasfeeSasCode>512</VasfeeSasCode>
             <BaseAmount>19.92</BaseAmount>
<PassThroughChargeAmount>0</PassThroughChargeAmount>
<PassThroughAdditionalChargeAmount>0</PassThroughAdditionalChargeAmount>
<TotalPassThroughChargeAmount>19.92</TotalPassThroughChargeAmount>
         </PassThroughCharge>
         <TotalCharge>157.27</TotalCharge>
         <PreviouslyPrinted>false</PreviouslyPrinted>
<UseCalculatedPassThroughValues>false</UseCalculatedPassThroughValues>
         <ServiceLevelCommitment>Service Level for 3220, AUSTRALIA:
Shipment delivered by end of day on Monday, May 20,
2013</ServiceLevelCommitment>
<ExpectedDeliveryDate>2013-05-20</ExpectedDeliveryDate>
         <Id>0</Id>
         <DeleteAfterVoid>false</DeleteAfterVoid>
         <Batch>false</Batch>
         <Inbound>false</Inbound>
<ConsigneeNotesConfirmed>false</ConsigneeNotesConfirmed>
     </Shipment>
</ns2:RateRouteResponse>

recvresp(): end with err
http_close(): entered

----------------------------------
Code snippit:
----------------------------------

D Form            s                   like(WEBFORM)
D rc              s             10I 0
D wait            s 1A
D url             s 1024A
D csv             s           4096A varying
D retdata         s 4096A
D retlen          s             10I 0
D nextpos         s             10I 0 inz(1)
D debugFile       s 100A
D myPointer       s *
D dataSize        s             10I 0

http_debug(*ON:%trim(debugFile));

url = 'http://' + %trim(dhlesIP) + ':2077';

csv = dhlesIN;

Form = WEBFORM_open();

WEBFORM_setPtr(Form : 'xml'  : %addr(csv) + 2 : %len(csv));

WEBFORM_postData(Form : myPointer : dataSize);

if http_url_post_raw(
url
                  : myPointer
                  : dataSize
                  : 1
                  : %paddr('INCOMING')
                  : HTTP_TIMEOUT
                  : HTTP_USERAGENT
                  : 'application/xml;charset=UTF-8' ) = 1;
    result = 'HTTP POST Success!';
else;
    result = 'MG120RG: http_url_post_raw failed' + debugFile;
endif;

WEBFORM_Close(Form);

*inlr = *on;

if  retlen > 3;
     http_xlate(retlen: retdata: TO_EBCDIC);
     dhlesOUT = %trimr(retdata);
     result2 = ' ';
else;
     result2 = 'POST Successful - no response data returned';
endif;
  /end-free

P incoming B
D incoming        PI            10I 0
D   descriptor                  10I 0 value
D   data                      8192A options(*varsize)
D   datalen                     10I 0 value
* Makre sure we don't overflow the string.
c                   eval      retlen = (nextpos + datalen) - 1
c                   if        retlen > %size(retdata)
c                   eval datalen=datalen-(retlen-%size(retdata))
c endif
c                   if        datalen < 1
c                   return 0
c endif
c                   eval      %subst(retdata: nextpos) =
c %subst(data:1:datalen)
c                   eval      nextpos = nextpos + datalen
c                   return datalen
P E
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------