[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting Error HTTP/1.1 501 Not Implemented.
Thanks Scott & Magne,
Well that was a humbling experience for me :| Obviously I'm well
versed in the post & get methods.
OK... I switched to using http_url_get_raw. I also, switched to using
the ZipCodeLookup API.
DAW1 //Construct the XML document.
DAW1 data = '<ZipCodeLookupRequest%20USERID="400MCKES0921">' +
DAW1 '<Address%20ID="0">' +
DAW1 '<Address1></Address1><Address2>6406%20Ivy%20Lane</Address2>' +
DAW1 '<City>Greenbelt</City><State>MD</State>' +
DAW1 '</Address></ZipCodeLookupRequest>';
DAW1
DAW1 //Construct the URL with the XML.
DAW1 rc = http_url_get_raw(
DAW1 'http://testing.shippingapis.com/' +
DAW1 'ShippingAPITest.dll?API=ZipCodeLookup&XML=' :
DAW1 1 : %paddr('INCOMING'));
DAW1
DAW1 //Check for error.
DAW1 if rc <> 1;
DAW1 msg = http_error;
DAW1 dsply msg;
DAW1 //return;
DAW1 endif;
DAW1
DAW1 //Convert the received data to EBCDIC character set.
DAW1 if retlen > 1;
DAW1 http_xlate(retlen : retdata : TO_EBCDIC);
DAW1 endif;
DAW1
DAW1 return;
I do get a response now. RC was equal to 1, so no fatal errors
occurred. This is the XML I get back, I will have to ask the USPS
about that.
<Error>
<Number>80040b19</Number>
<Description>XML Syntax Error: Error getting USERID attribute.</Description>
<Source>UspsCom::DoAuth</Source>
</Error>
Thanks again guys!
Dave
On Mon, Jan 17, 2011 at 1:48 PM, Magne Kofoed <magne.kofoed@xxxxxxxxxxx> wrote:
> Hi Dave,
>
> Your browser example is http get method.
> Maybe you should try a httpapi get example.
>
> "HTTP/1.1 501 Not Implemented" also indicates that the POST method is not
> supported.
>
> Best regards,
> Magne
>
> -----Opprinnelig melding-----
> Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] På vegne av David White
> Sendt: 17. januar 2011 18:35
> Til: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Emne: Getting Error HTTP/1.1 501 Not Implemented.
>
> Good Morning Everybody,
>
> I'm new to using the HTTPAPI. I searched for this error in the mailing
> list first but did not anything, so I decided to post this asking for
> some help.
>
> - What I'm trying to do is post an address to the USPS to get the zip code.
>
> - I modeled my program GETZIPCODE after EXAMPLE5. Here is the code
> that's running....
>
> c eval *inlr = *on
>
> DAW1 c
> DAW1 /free
> DAW1
> DAW1 //Construct the XML document.
> DAW1 data = '<AddressValidateRequest%20USERID="400MCKES0921">' +
> DAW1 '<Address ID="0">' +
> DAW1 '<Address1></Address1><Addreess2>6406 Ivy Lane</Address2>' +
> DAW1 '<City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4>' +
> DAW1 '</Zip4></Address></AddressValidateRequest>';
> DAW1
> DAW1 //Construct the URL with the XML.
> DAW1 rc = http_url_post_raw(
> DAW1 'http://testing.shippingapis.com/' +
> DAW1 'ShippingAPITest.dll?API=Verify&XML=' :
> DAW1 %addr(data):
> DAW1 %len(%trimr(data)):
> DAW1 1:
> DAW1 %paddr('INCOMING'));
> DAW1
> DAW1 //Check for error.
> DAW1 if rc <> 1;
> DAW1 msg = http_error;
> DAW1 dsply msg;
> DAW1 //return;
> DAW1 endif;
> DAW1
> DAW1 //Convert the received data to EBCDIC character set.
> DAW1 if retlen > 1;
> DAW1 http_xlate(retlen : retdata : TO_EBCDIC);
> DAW1 endif;
> DAW1
> DAW1 return;
>
> - Here is the error returned...
>
> Job 280312/DWHITE/QPADEV005Z held by user DWHITE with option SPLFILE(*NO)
> Job 280312/DWHITE/QPADEV005Z released by user DWHITE.
> DSPLY HTTP/1.1 501 Not Implemented
>
> - When I post this via the browser (Chrome) it works fine...
>
> http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressV
> alidateRequest%20USERID="400MCKES0921"><Address%20ID="0"><Address1></Address
> 1><Address2>6406%20Ivy%20Lane</Address2><City>Greenbelt</City><State>MD</Sta
> te><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>
>
> Anybody see what I'm doing wrong?
>
> Thanks!
>
> Dave
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------