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

Re: How do I get the response back using: HTTPAPI http_url_post_stmf



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>

Hello,

1.  I modified example 8 to use the new API to send an xml steam file from
the IFS to a vendor url.  (http_url_post_stmf)

2.  One of the parameters is a file in:   peRecvFile = Filename (in IFS) of
stream file containing reply.

3.  But the vendor to whom I am sending the data requires a URL for the xml
post back.

The HTTP protocol always involves making a request and receiving a reply, all as one transaction. In this case, the request is an XML document that's sent from you to the vendor. The response can be anything. It might just be the word "OKAY" to tell you that it worked, or it might be a 300k XML document. But there WILL be a reply. This is what gets saved to the "peRecvFile"


It sounds to me like your vendor wants you to send them the document, and they'll send you back a response that's as simple as "I got it!".

Then, at a later time, they'll use their own tool (which may be similar to HTTPAPI) to connect to your HTTP server and send you a "response" XML document.

This is just a guess, but it's the only way that having a URL for the response makes any sense at all. You'll want to talk with the vendor to make sure that this is right.


4. Is that necessary? How do I get the response/reply back?

Hard to know whether it's necessary, since I don't really know anything about the vendor or what you're exchanging documents about, etc. It's much, much, much more common to connect, send the XML document, and get the response document back all in one transaction. It's also much more secure -- running an HTTP server to receive responses back opens up new security risks that you have to consider.


You can use the HTTP server that comes with OS/400 to get the response back. Using CGI, an RPG program can be called by the HTTP server and can receive the document that the vendor sends to you.

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