NOAA SOAP Question
ericmedley
Senior Member - 3709 Posts
Hey all,
after about 5 hours of gnawing my own leg off...
I'm trying to POST into the SOAP server at NOAA.
I'm pretty sure I have the header correct since it does work with other SOAP severs but cannot suss out the URI I need.
Has anyone done this and have the URI or some helpful hints?
Here's what I have with one of the many failed URIs.
I (obviously) calculate the length of the SOAP XML message included and stick that at the end of the 'Content Length: ' line with a CRLF.
I can keep guessing as there are only 28 letters in the alphabet X 2 for lower case/caps and 10 digits. I might be able to guess the URI in about 397 years or so. But, if one of you scholarly fellows can throw me a bone, I'd appreciate it.
Thanks!
e
after about 5 hours of gnawing my own leg off...
I'm trying to POST into the SOAP server at NOAA.
I'm pretty sure I have the header correct since it does work with other SOAP severs but cannot suss out the URI I need.
Has anyone done this and have the URI or some helpful hints?
Here's what I have with one of the many failed URIs.
SOAP_Server_URL='graphical.weather.gov' SOAP_Header=" 'POST /xml/DWMLgen/ HTTP/1.1',13,10, 'Host: http://graphical.weather.gov',13,10, 'Content-Type: application/soap+xml; charset=utf-8',13,10, 'Content-Length: ' "
I (obviously) calculate the length of the SOAP XML message included and stick that at the end of the 'Content Length: ' line with a CRLF.
I can keep guessing as there are only 28 letters in the alphabet X 2 for lower case/caps and 10 digits. I might be able to guess the URI in about 397 years or so. But, if one of you scholarly fellows can throw me a bone, I'd appreciate it.
Thanks!
e
Comments
-
All I get are BAD REQUEST responses, what is /xml/DWMLgen expected to retrieve? On a similar server I've used this in the past:
DEFINE_FUNCTION CHAR fnGetSAT_HTML()//****************************used {//http://en.wikipedia.org/wiki/HTTP_OPTIONS#Request_methods SEND_STRING dvRAD_SAT,"'GET /satellite/displaySat.php?region=',cGetRegion,'&isingle=multiple&itype=',cGetImageType,CR,LF" ; //HTTP/1.1 SEND_STRING dvRAD_SAT,"'Host: adds.aviationweather.gov',CRLF" ; SEND_STRING dvRAD_SAT,"CRLF" ;//blank line required if (nDebug) { SEND_STRING 0,"'TP_RAD_SAT GET Sent for Updated File List.<-line-<',ITOA(__LINE__),'>',CR,LF" ; } RETURN TRUE ; } and.... SEND_STRING dvRAD_SAT,"'GET /data/satellite/',cCurGetFileName,CR,LF" ; //HTTP/1.1 SEND_STRING dvRAD_SAT,"'Host: adds.aviationweather.gov',CRLF" ; SEND_STRING dvRAD_SAT,"CRLF" ;//blank line required for(i = 1; i < NUM_SAT_FILES + 1 ; i ++) // { if(find_string(cCurGetFileName,"cSatFileNames[i]",1)) { nCurFile = i ; i = NUM_SAT_FILES + 1 ; } }I don't run this anymore so I don't know if it still works.
I tried your code w/o the HTTP/1.1',13,10, since my old code didn't use it and some new stuff I'm working with wouldn't work if that was included either. This is what I get running as a GET and POST.Line 7 (06:44:53):: CIpEvent::OnLine 0:12:1 Line 8 (06:44:53):: Memory Available = 17695584 <14816> Line 9 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-1], Online, Send Command-[ 4 ] :DEBUG<436> Line 10 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-1], fnDevMod_SendCmd, STR-[ GET /xml/DWMLgen$0D$0AHost: http://graphical.weather.gov$0D$0AContent-Type: applicat Line 11 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-2], ion/soap+xml; charset=utf-8$0D$0AContent-Length: $0D$0A$0D$0A ] :DEBUG<544> Line 12 (06:44:53):: Exiting TCP Read thread - closing this socket for local port 12 Line 13 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-1], String, RX-[ HTTP/1.0 400 Bad Request$0D$0AServer: AkamaiGHost$0D$0AMime-Version: 1.0$0D$0AContent-Type: text/ht Line 14 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-2], ml$0D$0AContent-Length: 216$0D$0AExpires: Thu, 20 Jun 2013 10:44:53 GMT$0D$0ADate: Thu, 20 Jun 2013 10:44:53 GMT Line 15 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-3], $0D$0AConnection: close$0D$0A$0D$0A<HTML><HEAD>$0A<TITLE>Bad Request</TITLE>$0A</HEAD><BODY>$0A<H1>Bad Request</H1>$0AYo Line 16 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-4], ur browser sent a request that this server could not understand.<P>$0AReference #7.b56a031 Line 17 (06:44:53):: SynSS MOD-[ 1 ] DEBUG:[L-5], 7.1371725093.0$0A</BODY>$0A</HTML>$0A ] :DEBUG<2208> Line 18 (06:44:53):: CIpEvent::OffLine 0:12:1 Line 21 (06:45:02):: Connected Successfully Line 22 (06:45:02):: CIpEvent::OnLine 0:12:1 Line 23 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-1], Online, Send Command-[ 5 ] :DEBUG<436> Line 24 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-1], fnDevMod_SendCmd, STR-[ POST /xml/DWMLgen$0D$0AHost: http://graphical.weather.gov$0D$0AContent-Type: applica Line 25 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-2], tion/soap+xml; charset=utf-8$0D$0AContent-Length: $0D$0A$0D$0A ] :DEBUG<558> Line 26 (06:45:02):: Exiting TCP Read thread - closing this socket for local port 12 Line 27 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-1], String, RX-[ HTTP/1.0 400 Bad Request$0D$0AServer: AkamaiGHost$0D$0AMime-Version: 1.0$0D$0AContent-Type: text/ht Line 28 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-2], ml$0D$0AContent-Length: 216$0D$0AExpires: Thu, 20 Jun 2013 10:45:02 GMT$0D$0ADate: Thu, 20 Jun 2013 10:45:02 GMT Line 29 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-3], $0D$0AConnection: close$0D$0A$0D$0A<HTML><HEAD>$0A<TITLE>Bad Request</TITLE>$0A</HEAD><BODY>$0A<H1>Bad Request</H1>$0AYo Line 30 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-4], ur browser sent a request that this server could not understand.<P>$0AReference #7.2c6a031 Line 31 (06:45:02):: SynSS MOD-[ 1 ] DEBUG:[L-5], 7.1371725102.0$0A</BODY>$0A</HTML>$0A ] :DEBUG<2208> Line 32 (06:45:02):: CIpEvent::OffLine 0:12:1
I also tried with just the GET/POST & Host and got the same bad request so maybe if I new what you're trying to retrieve with /xml/DWMLgen I might be of more help. -
I did find this:
http://graphical.weather.gov/xml/DWMLgen/schema/meta_data.xsd and learned DWML stands for:
"Digital Weather Markup Language"
Seems like DWML might be in the path to what you're looking for but not the end location. -
Vining,
Thanks for the reply!
The message I'm sending is a SOAP XML request. It's a preformatted XML file that tells the server to send back a whole slew of information in a SOAP XML response.
SOAP works on the same port as web traffic. (port 80) It works similarly to an SQL query and/or php? request. The requested information is embedded in the request.
What I'm finding online is similar to what I run into all the time with trying to get AMX to talk to a computer.
all the discussion is very computer centric. So, for example when I look for the actual format of the SOAP request I get reams of discussion about which calls to make in UNIX or how to properly call the built-in SOAP utility in VBasic or the part about the SOAP container. It's hard to find what the whole message being sent by the client looks like. "Because who does that crap anymore??? sheesh! Ask for the time and you want to build me a clock.."
It took me hours just to find an actual working example that I could test on a real server.
anyway... so the POST command is what's mentioned in all the examples of invoking a SOAP conversation.
Thanks for trying!
e -
oh,
here's a sample SOAP conversation.A SOAP request: POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope> The SOAP response: HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope> -
Maybe this link will help you:
http://graphical.weather.gov/xml/ -
ericmedley wrote: »Has anyone done this and have the URI or some helpful hints?
Nope, no and maybe in that order.
I would suggest the following:
1. Get it working using the Poster plugin for Firefox first. It's not going to help you determine the URI, but once you make a properly formed post using Poster, you can check the transactions using Wireshark so that you can implement the posts unchanged in Netlinx. Poster should take out a lot of the variables and speed things up.
https://addons.mozilla.org/en-US/firefox/addon/poster/
2. Check that you are using the right line endings in the content you are posting. From memory, likely to be CR/LF pairs in the header and CR's (no LF) in the content. -
With the one SOAP protocol that I've worked with in the past, the HTTP header also required a SOAPAction field. Taking inspiration from various "operations" in http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl I would try adding this into your HTTP header:
'SOAPAction: NDFDgenByDay',CRLF
... or whatever SOAP action you are trying to perform. That action may need to be a full URL - that would depend on if/how the NOAA server parses it.ericmedley wrote: »I (obviously) calculate the length of the SOAP XML message included and stick that at the end of the 'Content Length: ' line with a CRLF.
You might have done the following, but it's not entirely clear from your OP... (Sorry if I'm stating the obvious.) Did you include the additional CRLF between the http header and body? It should look something like this:"firstPartOfYourHTTPHeader_withCRLF, 'Content Length: ', itoa(length_array(theBody)), CRLF, CRLF, theBody"
Yours,
Roger McLean
Swinburne University -
Thanks to you all for all the replies,
In most cases I did try all those things. Suffice it to say I ended up going a slightly different route. There is a way to use their database query with simple PHP and HTTP that gets me the same result. I parked the SOAP idea for a while until I can get to it. My only worry is that at some point they might get around to rewriting the query script and thatbwill break my code. The SOAP solution is more permanent.
Anyway, thanks so much!
Eric
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
