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

RE: Does anyone have an example of a program that READS data from the IFS and sends the data via the webservice?



This looks pretty straight forward. Let's see if we understand. 

You have pipe delimited file in the IFS.

The wsdl you sent looks like a document archiving service. It is going to take the whole file so you will not need to parse it. Is that true?

How big is the file and what OS release are you on?

One possible solution is to read the file into a variable in your program. Build the XML concatenating the data in the right place inside your program.

Here is an example of reading a file into a variable:
http://blog.mowyourlawn.com/?p=161

This versions is using 65535a for the variable. So that is a limit you need to be aware of. Concatenating with XML will make the variable even larger. On V7 you can create variables up to 16,773,100.

If you need to send larger files, one method would be to create the xml in an IFS file and then send directly from the stmf. 


< copied from other post > 

"webservice" is used for each and everything when people speak about a
"service" provided over the "web", when the client is a program and not a
human sitting in front of his browser. But under the cover there are
several different approaches to connect programs over the Internet.

In order to help you, we need to know more details about your webservice.

First, we are the client in this process. 

a) What kind of a webservice is it: SOAP, Restful, or whatever else? 
First, we are the client in this process and we have a WSDL from the 
client.  

Given that it is a SOAP webservice and hence using XML, the next question
was:

b) Do you need to add your IFS data to an XML element or as an attachment? 
 It is not an attachment but as an Element.  Here are the parms

* RPG call : stub_op_EnviaArchivo 
*  C call  : EnviaArchivo 
*  parm in : AXISCHANDLE this 
*  parm in : xsdc__string Value0 
*  parm in : xsdc__string Value1 
*  parm in : xsdc__string Value2 
*  parm in : xsdc__string Value3 
*  parm in : xsdc__string Value4 
*  parm in : xsdc__string Value5 
*  parm in : xsdc__int Value6 
*  parm in : xsdc__int Value7 
*  parm in : xsdc__string Value8 
*  parm in : xsdc__base64Binary Value9 
*  parm in : xsdc__string Value10 
*  parm out: xsdc__string out 
*  parm out: xsdc__string out 
* return  : *ON = success 
          : *OFF = failure 
                                          
Given that it is an XML element, the next question was:

c) Is it added as CDATA or plain text or Base64 encoded? BASE64

For sure there will be more questions, once we got an answer to these
first questions.

Last but not least, did you get a WSDL file from the service provider?
Then it is a SOAP web service and you may post it here. Yes and it is 
loaded.




-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Raul A. Jager W.
Sent: Thursday, January 16, 2014 5:45 AM
To: HTTPAPI and FTPAPI Projects
Cc: Joe.Oconnor@xxxxxxx
Subject: Re: Does anyone have an example of a program that READS data from the IFS and sends the data via the webservice?

By setting the Apache to allow access the file will be ready to be 
"pulled" by the other computer.

You can also send (push) the file to a web service reading it into a 
variable and using http_url_post_raw (I use that to send JSON to a server).

Also see example8



Robin.Kresin@xxxxxxx wrote:

>   ALL;
>   We save the invoice data to the IFS so it is pipe delimited, etc.
>   We need to create a webservice program that takes that data from the
>   IFS and then send it to the web server of another company.  In all the
>   examples, I see where I can save to the IFS or get a quote, etc.
>   However, I need an example of something extracting data from the IFS
>   and sending the data to the service provider.
>   Example: In EXAMPLE1 we receive a pdf into our IFS.  We want to send
>   someone data from OUR IFS to their server.
>   Has anyone else done something like this?
>   Any help would be appreciated.
>   Robin Kresin
>   Sr. Programmer / Analyst
>   TVH(r) - TotalSource(r) Parts and Accessories
>   Phone: 913.829.1000 ext.3035 Direct: 913-768-3035
>   E-mail: robin.kresin@xxxxxxx
>   website: [1]www.tvh.com
>
>   The information in this e-mail and any attachments is confidential
>   and is intended solely for the attention and use of
>   ftpapi@xxxxxxxxxxxxxxxxxxxxxx.
>   If you are not the intended recipient, or person responsible for
>   delivering this information to the intended recipient, please notify
>   the sender immediately and destroy this e-mail and all copies of this
>   e-mail on any storage mechanism.
>   Unless you are the intended recipient or his/her representative you are
>   not authorized to, and must not, read, copy, distribute, use or retain
>   this message or any part of it.
>
>References
>
>   1. file://localhost/tmp/www.tvh.com
>
>  
>
>------------------------------------------------------------------------
>
>-----------------------------------------------------------------------
>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
-----------------------------------------------------------------------