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

RE: Which API ?



EXAMPLE16 is a pretty clean program for sending and receiving data. I think it would be a fine starting point.

>And just for my educational curiosity, why do you suggest against using "http_url_post_stmf_xml"?

The question isn't against using it...but why use it?
One reason to use it is if the data is HUGE. But if on a current version of the OS, you can do the work with LARGE variables (even the earlier OS supported 32,000 byte character fields - pretty big for most web services!).
Another reason is if you having trouble "seeing" what you are creating. This is a fine debug technique if you aren't otherwise using a quality debugger or some little glitch is preventing you from "seeing" the XML correctly. Saving the XML to a stream file will allow you to open it with an XML reader/editor and see if it can be parsed successfully.
Another reason is if you have a separate program creating the data from the program consuming the data.
And the final reason I would use it is if I needed to save the requests so I could do some history on them.

From what you have said so far, none of those reasons apply so use a variable.  It keeps the program much cleaner to do it in a variable and saves the "time and expense" of writing the data to the IFS which requires httpapi to read the data from a file.

Writing to the IFS pseudo code...
Open file
Do until done
	- Create a line of file data
	- Write to file
Close file
Call http_url_post_stmf_xml
	- open file
	- Do until done
		- read data from file
	- close file
Delete file from IFS

Using a variable...
Create the variable
Call http _url_post_xml


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Max Buda
Sent: Thursday, January 8, 2015 1:37 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Which API ?

Mike,
the sample data I attached is what we need to send to the web service, in order to get back a response.
I created the file through my RPG program.
Now it's a matter of adding the appropriate HTTPAPI to send the data and receive the response.
Would Example 16 be closer to what I need (except for the user ID and password), instead of 14 ?

And just for my educational curiosity, why do you suggest against using "http_url_post_stmf_xml"
?

As for the tag names, unfortunately that's what we were give.
Maybe, they are also new to web services and XML.



Thanks

Max Buda


On Thu, Jan 8, 2015 at 11:37 AM, Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>
wrote:

> The data you provided is being sent? It kind of looks like something 
> you would receive as client.
>
> http_url_post_stmf_xml will certainly work but I would skip the stmf 
> unless you need to see the data you are sending for some reason.
>
> If you haven't been through the examples yet, please do spend an hour 
> or two trying to get them to run or at least doing a desk check of the 
> program. Do them in numerical order as EXAMPLE2 follows EXAMPLE1. If 
> you do
> 1 then 10, you will miss a few steps in between.  I think you will 
> find that this stuff is not as mysterious as it first seems.
>
> Most web services are pretty simple. Mostly, you send some data 
> (usually pretty minimal) to a provider and they send back a bunch of 
> data. Sometimes it is reversed if you are updating something on their 
> system (you send large data and get back small data).
>
> In your case, the example data is not very large. I would build in a 
> variable. It should work using EXAMPLE14 as base. I hope the return 
> data is better than what you have but I doubt it. Whoever set up that 
> XML totally blew it in my book. Calling everything VALUE is not the 
> "right way" but you can work with it. It is just a little more work.
>
>
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:
> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Max Buda
> Sent: Thursday, January 8, 2015 10:42 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: Which API ?
>
> I am new to web services and need some help / direction.
>
> I need to consume a web service provided by our customer.
> The xml data we need to provide is large enough that I'm wondering 
> whether to use a variable to pass the data (http_url_post_xml) or 
> whether to create an IFS file and send it through a different API.
> Is "http_url_post_stmf_xml" appropriate for this ?
> If so, what are the steps required to use it ?  An example would 
> really be appreciated.
>
> I have attached a sample of the data required by the web service.
>
>
> Thanks
>
> Max Buda
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------