[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to format a request to a web service
Hello joneill,
First of all, please consider using HTTPAPI. Sockets is an API for
performing network communications -- and as such, the focus of the
tutorial is to explain how to write programs that communicate over a
network.
HTTP is one particular protocol for talking over a network. There are
many others (SMTP used for E-mail, FTP used for file transfer, PING used
for network diagnostics, Telnet for communicating with terminals, NTP used
for synchronizing clocks... the list goes on and on.) All of them use
sockets to communicate over a network...
There's more to HTTP than just sockets. Sockets tells you how to send
bytes over a network. HTTP tells you which bytes to send in which order,
and which responses to receive, and so on... everything you need to know
to be a web server or communicate with a web server.
Web Services is more than just HTTP, as well. Web services uses HTTP to
communicate over a network, but that's just one piece of the puzzle.
There's also the formatting of messages, the parsing of response messages,
knowing what messages to send... there's a lot more than just the
communications.
I guess what I'm trying to say is this: Don't go to a tutorial about
sockets and expect to walk away knowing about Web services! It would be
like taking a class on "how electricity works" and expecting to walk out
of the class understanding how to engineer and build your own cell phone.
Sure, cell phones use electricity, but there's a lot more to it than that!
HTTPAPI is a toolkit that takes care of the HTTP protocol for you. It
simplifies your life by NOT requiring you to understand the inner workings
of the HTTP protocol. You just tell it to GET or POST, and where to
get/put the data that's uploaded/downloaded and let it do the work.
Obviously, HTTPAPI uses sockets in order to do this... but again, the
sockets are only part of the puzzle.
You can download HTTPAPI and lots of sample programs at the following
link:
http://www.scottklement.com/httpapi/
I've written a number of articles about calling Web services using
HTTPAPI.
"RPG Can Consume Web Services" (iSeries NEWS magazine, July 2006)
http://www.systeminetwork.com/article.cfm?id=20590
"RPG as a Web Service Consumer" (Club Tech Programming, Feb 9, 2006)
htt://www.systeminetwork.com/article.cfm?id=52099
"RPG as a Web Service Consumer, Part 2" (March 16, 2006)
htt://www.systeminetwork.com/article.cfm?id=52258
You might also find it helpful to search the archives of this mailing
list:
http://www.scottklement.com/archives/ftpapi/
If your question is "how do I generate SOAP documents from this WSDL?"
then you might be interested in the following Web site:
http://www.soapclient.com/SoapTest.html
--
Scott Klement http://www.scottklement.com
On Fri, 13 Oct 2006, joneill@xxxxxxxx wrote:
> Good Friday afternoon.
>
> I've copied Scott's basic program from the sockets tutorial and it
> works beautifully, showing me all the HTML from a the web page of my
> choice. I would like to use it to call a simple web service. There's lots
> out there, and I've been trying to get them to work, but for all the info
> available, I can't figure out how to format the 'request' field to call
> the service. In particular, I've been trying to just get the getCity(zip)
> method at
>
>
> http://webservices.imacination.com/distance/Distance.jws?wsdl
>
> to work. I can connect, but can't invoke the service. Am I on the wrong
> planet?
>
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------