[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Receving data past back from a webservice



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


> I have an RPGLE program that I am working on that needs to call a web
> service.  I will be passing it two strings.  The webservice will be
> sending back a number that I need to read.  Where/how can I get that?
> Can I retrieve that from the IFS?  Which prototype do I need to use?

You can have the data returned straight to your program or you can have
the data saved to the IFS.  Either way works, depending on what you're
doing.

If all you're getting back is a single number, it's probably not a lot of
data, so I'd personally want it passed back to my program.  If it were a
larger piece of data, I might prefer to save it to the IFS.  But I guess
it's up to you.

Take a look at the sample programs included with HTTPAPI.  They are called
EXAMPLE1 - EXAMPLE17. They all demonstrate sending data to a web server
and getting back a response in some form or another.

The real question is, what does the webservice expect you to send?  How
does the data need to be encoded? URL encoded? Multipart form-data? XML?
What will the result be encoded as, and how do you plan to decode it?

Those are the real questions you need to have answered. Since every web
service is different, you'll have to find out what's expected from the
people who provide the web service...

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------