|
I thought I would come into the office today and see if I
could learn Web Services (by example).
I am trying to use Scotts Example Program LOCWEATH
Any help or pointers would be greatly appreciated
CALL LOCWEATH PARM('30097')
Compiles Fine
I can ping to the www.weather.gov
HTTP is up and running
I am trying this on IBM i 6.1
When I run the program I get error - HTTP/1.1 301 Moved
Permanently
(I have included the log file below)
Running in Debug I see the program gets to the
NOAA_LatLonZipCode procedure
Variable SOAP =
....5...10...15...20...25...30...35...40...45...50...55...60
1 '<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchem'
61 'a-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml'
121
'ns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns'
181
':ndf="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndf
d'
241 'XML.wsdl"> <soapenv:Header/> <soapenv:Body>
<ndf:LatLonListZ'
301 'ipCode
soapenv:encodingStyle="http://schemas.xmlsoap.org/soa'
361 'p/encoding/"> <zipCodeList
xsi:type="xsd:string">30097</zipC'
421 'odeList> </ndf:LatLonListZipCode> </soapenv:Body>
</soapenv:'
481 'Envelope>
'
Then when http_xproc( HTTP_POINT_ADDL_HEADER
: %paddr(SoapActionLL) );
Is executed it appears to run ok
Then when rc = http_url_post_xml(
'http://www.weather.gov/forecasts/xml/+
SOAP_server/ndfdXMLserver.php'
: %addr(SOAP) + 2
: %len(SOAP)
: *NULL
: %paddr(endTag)
: %addr(LatLon)
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'text/xml');
Is executed rc=301
and http_error(errnum);
if (errnum<>HTTP_XMLERR or x=15);
http_crash();
endif;
causes the eventual error HTTP/1.1 301 Moved Permanently
Log file:
************Beginning of data**************
HTTPAPI Ver 1.23 released 2008-04-24
OS/400 Ver V6R1M0
New iconv() objects set, PostRem=819. PostLoc=0.
ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'00000136'
DNS default domain: DRVTECH.COM
DNS server found: 205.152.37.23
DNS server found: 205.152.150.23
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /forecasts/xml/SOAP_server/ndfdXMLserver.php HTTP/1.1
Host: www.weather.gov
User-Agent: http-api/1.23
Content-Type: text/xml
Expect: 100-continue
Content-Length: 489
SOAPAction:
"http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.w
sdl#LatLonListZipCode"
recvresp(): entered
HTTP/1.1 301 Moved Permanently
Server: Apache/2.2.15 (Red Hat)
Location:
http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.p
hp
Content-Length: 352
Content-Type: text/html; charset=iso-8859-1
Date: Sat, 01 Jun 2013 13:36:19 GMT
Connection: keep-alive
SetError() #13: HTTP/1.1 301 Moved Permanently
recvdoc parms: identity 352
header_load_cookies() entered
recvdoc(): entered
SetError() #0:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head> <title>301 Moved Permanently</title>
</head><body> <h1>Moved Permanently</h1> <p>The document has
moved <a
href="http://graphical.weather.gov/xml/SOAP_server/ndfdXMLse
rver.php">here</a>.</p> < <hr> <address>Apache/2.2.15 (Red
Hat) Server at www.weather.gov Port 80</address>
</body></html>
SetError() #13: HTTP/1.1 301 Moved Permanently
http_close(): entered
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.