× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Scott,

I have looked at this web page and all the links
Unfortunately I am new at this web services stuff (trying to
learn by using your example program LOCWEATH)

So I did go to this web page and looked at all the links and
it doesn't help me the newbie.

I changed what I though needed to be changed but I get the
same error :(
Can you tell me what line or lines in your program LOCWEATH
would need to be changed and what they need to be changed
to?

Once I get the program working then I think I can play
around with it and learn better (I prefer learn by example
method)


Thanks in advance for all your help


-----Original Message-----
From: Scott Klement [mailto:rpg400-l@xxxxxxxxxxxxxxxx]
Sent: Saturday, June 01, 2013 7:57 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Attempting to learn Web Services (by example)

It would appear that the web service has moved to a
different server. A quick Google finds this page with all
the details:
http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.p
hp

On 6/1/2013 8:45 AM, John Allen wrote:
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














--
This is the RPG programming on the IBM i (AS/400 and
iSeries) (RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2904 / Virus Database: 3184/6369 - Release
Date: 05/30/13


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.