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

Re: HTTP POST help (Kalyan Tirumamidi)



Kalyan,

These methods all perform exactly the same.  Under the covers they are 
calling the same internal routines inside HTTPAPI.

Use the one that's appropriate to the task you are attempting to 
accomplish.





Kalyan Tirumamidi wrote:
> Scott / all - Can you tell me what you think?
> 
> -----Original Message-----
> From: Kalyan Tirumamidi 
> Sent: Wednesday, September 02, 2009 12:23 PM
> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: HTTP POST help (Kalyan Tirumamidi)
> 
> Thanks Scott. Can you tell (suggest) me a specific method out of the 3
> methods http_post_xml(), http_post() and http_post_stmf() in terms of
> performance?
> 
> My scenarios is like there will be multiple people making the web
> service request from different locations and in some cases I am looking
> for a faster response like less than a second. I understand it may
> depend on the network speeds and the web service response time etc but
> will there be any time consumed if we use IFS which may have more
> retrieval times compared to memory?
> 
> Suggest me please.
> 
> Regards
> Kalyan
> 
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
> Sent: Wednesday, September 02, 2009 11:17 AM
> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Ftpapi Digest, Vol 39, Issue 2
> 
> Send Ftpapi mailing list submissions to
> 	ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.scottklement.com/mailman/listinfo/ftpapi
> or, via email, send a message with subject or body 'help' to
> 	ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
> 
> You can reach the person managing the list at
> 	ftpapi-owner@xxxxxxxxxxxxxxxxxxxxxx
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Ftpapi digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Consuming Web Services (Scott Klement)
>    2. Re: http_url_post_xml (Scott Klement)
>    3. Re: Consuming Web Services (Jon Paris)
>    4. HTTP POST help (Kalyan Tirumamidi)
>    5. Re: HTTP POST help (Scott Klement)
>    6. HTTP/1.1 500 Internal Server Error (Tony.Davis2@xxxxxxx)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 01 Sep 2009 12:46:36 -0500
> From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
> Subject: Re: Consuming Web Services
> To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Message-ID: <4A9D5DFC.7070006@xxxxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Selders, Vince E wrote:
>> I've downloaded the tool and have imported the wsdl, however it tells
> me
>> the XML declaration is not well formed.  
> 
> For your WSDL?  That's not a good sign.  I would try re-downloading the 
> WSDL.  Be very careful to make sure it's not being mistranslated or 
> extra characters are added.
> 
> If you still get an error that your WSDL is not well-formed, contact 
> whomever is in charge of that web service.  A WSDL that's not 
> well-formed is a rather severe error in creating a web service.
> 
> 
>> I have decided to read through the docs to see what I might be doing
>> wrong.  Like a true developer I simply loaded the app and started
>> forcing things into place, guess I'll need to figure out how it works
>> first :-)
> 
> ??? Are we still talking about SoapUI and the WSDL being wrong?
> 
> 
>> I wanted to use one of the examples you sent out, but our iSeries is
>> tied down pretty tight and I can't get to the website.  So now I am
>> trying to hit what is supposed to be a simple web service via our
>> intranet. 
> 
> Again, start with SoapUI.  Run the WSDL through it and try it out that 
> way.  When you get that working, then try to automate the process with 
> HTTPAPI.
> 
> 
>> This is a very critical piece in that, like many companies,
>> we have a directive to get away from emulators and begin using
> browsers.
> 
> I don't understand what web services have to do with using browsers 
> instead of 5250?!
> 
> Web services have little do to with user interfacing.  I wonder if you 
> aren't confusing web services with standard web programming.
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 01 Sep 2009 12:47:21 -0500
> From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
> Subject: Re: http_url_post_xml
> To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Message-ID: <4A9D5E29.6040306@xxxxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> The parameters to http_url_post_xml() should be documented in the 
> comments of the HTTPAPI_H source member.
> 
> Selders, Vince E wrote:
>> Hello again.
>>
>> Can anyone explain the http_url_post_xml method?  I think I have
> almost
>> everything set up but seem to be failing here.
>> rc = http_url_post_xml(
>>                   'http://somewhere.com' 
>>                    : %addr(SOAP) + 2
>>                    : %len(SOAP)
>>                    : *NULL
>>                    : %paddr(Incoming)
>>                    : %addr(searchString)
>>                    : HTTP_TIMEOUT
>>                    : HTTP_USERAGENT
>>                    : 'text/xml'
>>                    : 'http://somewhere.com');
>>
>> I simply don't understand what all of this is.
>>
> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>>
> -----------------------------------------------------------------------
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Tue, 1 Sep 2009 15:03:24 -0400
> From: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
> Subject: Re: Consuming Web Services
> To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Message-ID: <7CCC20AB-BF5B-48A5-80A7-CEFBAFFE853F@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
> 
> On 1-Sep-09, at 1:46 PM, Scott Klement wrote:
> 
>> Selders, Vince E wrote:
>>> I've downloaded the tool and have imported the wsdl, however it  
>>> tells me
>>> the XML declaration is not well formed.
>> For your WSDL?  That's not a good sign.  I would try re-downloading  
>> the
>> WSDL.  Be very careful to make sure it's not being mistranslated or
>> extra characters are added.
> 
> I have had this problem with SoapUI twice. It appears to be very very  
> fussy about any characters between the tags in the wdsl.  The error  
> message it gives is very misleading because the XML is in fact well  
> formed - I confirmed this with two different XML validators.
> 
> Some sites when you download the wsdl include hyphens ("-") between  
> the tags - which is how it appears in a browser.
> 
> The wsdl I had trouble with looked like this:
> 
> <tag ..... >
>     <andothertag ... >
>      -
> Manually removing the hyphens cleared the problem.
> 
> 
> Jon Paris
> 
> www.Partner400.com
> www.SystemiDeveloper.com
> 
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Tue, 1 Sep 2009 18:15:17 -0400
> From: "Kalyan Tirumamidi" <KTirumamidi@xxxxxxxxxxxxxxx>
> Subject: HTTP POST help
> To: <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Message-ID:
> 	
> <8F12C14A3855134D967D6D79DFDDEB830692FBF9@xxxxxxxxxxxxxxxxxxxxxxxxxx>
> Content-Type: text/plain;	charset="us-ascii"
> 
> Hi - After lots of deliberations we are now back to HTTP Post using
> Scott's tool. As Thomas explained earlier I am now using the
> http_post_xml() call to post the XML file to a message broker. Since I
> do not completely understand all the parameters passed to it I am using
> the sample program EXAMPLE16 as an example for this. 
> 
> What I do not understand is where is the XML I received back from the
> web service. Is there a way I can capture that file? 
> 
> Later I will use EXPAT (not sure how to invoke EXPAT yet though) to
> parse the file. But for the initial test purposes can some one tell me
> how to capture the file I received? Will it be on IFS? If yes how do I
> know the path?
> 
> Please help.
> 
> Regards
> Kalyan
> 
> 
> -----Original Message-----
> From: Kalyan Tirumamidi 
> Sent: Monday, August 31, 2009 12:38 PM
> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: Missing tags in the web service XML creation
> 
> Scott - Thanks for your reply. Your inputs have helped me a lot to
> understand the pros and cons of the different ways of doing the web
> service calls. 
> 
> I have dropped the plan of using Thomas's WSDL2RPG as his tool will take
> some time to complete the <extension> in conjunction with <sequence> in
> order to make the correct web service call. Hence we are for now
> manually preparing the XML file and using IBM MQ Client to post the
> message. We are then writing the XML parsing using the XML SAX.
> 
> Wish me good luck.
> 
> Regards
> Kalyan
> ------------------------------------------------------------------------
> --
> 
> Message: 3
> Date: Thu, 27 Aug 2009 17:48:17 -0500
> From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
> Subject: Re: Missing tags in the web service XML creation
> To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Message-ID: <4A970D31.4030002@xxxxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> hello Kalyan,
> 
>> - If it is worth a question can you please tell me how different is
>> EXPAT compared to IBM supplied XML-SAX parser? I just started reading
>> documentation on IBM for XML parsing.
> 
> The general concept of XML-SAX and Expat are about the same.  The 
> overall paradigm is the same.
> 
> With regards to how they read the XML data.  XML-SAX is simpler, but 
> Expat is more flexible.  With Expat, you have to write your own routine 
> to read the data -- which means you have to do more work.  That gives 
> you added flexibilty (for example, you can get the data from a network 
> instead of a disk file) but you need to know/understand the programming 
> to do so.  XML-SAX reads the file for you, which means you don't have to
> 
> do it -- but is only capable of reading a variable or stream file.  It 
> can't read from a pointer or network socket.
> 
> With regards to how the handlers work...   XML-SAX calls only one 
> handler routine, and passes an integer that identifies which event has 
> occurred. The parameter list is therefore the same for every event 
> (which it has to be, since there's only one routine to call)
> 
> By contrast, Expat requires a separate event handler for each event, and
> 
> has parameter lists taylored for that event.
> 
> Those are the main differences -- and about as much as I can explain 
> without turning it into a very long complicated e-mail message.
> 
> 
>> - I am trying to understand your sample programs in LIBHTTP and find
>> which is going to be the version I should use as there seems to be
>> different methods of XML parsing in there.
> 
> Hmmm... not sure that I follow that?  Maybe I'm interpreting the word 
> "method" differently than you mean it, but...   there's only one method 
> of parsing included with HTTPAPI, and that's Expat.
> 
> You can, of course, get the document itself and parse it with a 
> different parser that's not included with HTTPAPI.
> 
> 
>> - Also I do not know if I can use SOAPUI since our company has already
>> developed a generic RPG application to generate a XML file to POST to
>> the web service. Would that cause any issues in using your EXPAT
> utility
>> to parse the response file?
> 
> Weren't you planning to use Thomas Raddatz's WSDL2RPG?? I'm confused. 
> SoapUI would calculate the SOAP message, just as Thomas's tool would do 
> it.  The only difference is that SoapUI won't generate RPG code for you,
> 
> you'll have to generate it yourself.
> 
> If your company is already generatign the SOAP message, then you'd want 
> to use HTTPAPI directly, and not go through SoapUI *or* WSDL2RPG.
> 
> Unless you mean that your company's data is actually an XML payload of a
> 
> SOAP message, as opposed to the SOAP message itself.  If that's the 
> case, then you should be able to use it with either approach.
> 
>> - Lastly, your example in HTTPXMLR4 seems to contain both HTTP POST as
>> well as EXPAT parsing. Is that correct?
> 
> HTTPXMLR4 is *not* an example.  It's one of the modules of HTTPAPI.  The
> 
> examples are named EXAMPLE1, EXAMPLE2, EXAMPLE3, and so forth.
> 
> HTTPXMLR4 is part of the code of the HTTPAPIR4 service program, and is 
> definitely not something I'd start learning from, as it's rather 
> advanced coding.
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 28 Aug 2009 08:46:55 +0200
> From: thomas.raddatz@xxxxxx
> Subject: Antwort: Re: Missing tags in the web service XML creation
> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Message-ID:
> 	
> <OFD8BCA23F.DA3A829B-ONC1257620.00223E99-C1257620.00254762@xxxxxx>
> Content-Type: text/plain; charset=US-ASCII
> 
> 
> Kalyan,
> 
>> - I am trying to understand your sample programs in LIBHTTP and find
>> which is going to be the version I should use as there seems to be
>> different methods of XML parsing in there.
> 
> Usually you will use http_post_xml() to send your SOAP request to the
> server and automatically invoke the eXpat parser on the response
> received
> from the server. I assume that this approach is common sense for calling
> a
> web service. http_post_xml() is the very same procedure as
> http_url_post_xml(). It is mapped to http_url_post_xml() in member
> HTTPAPI_H. I do not know why both procedure names exist.
> 
> Some times, but I cannot explain why, you will use http_url_get() or
> http_url_post() to send a request to the server but put the response
> into
> an IFS stream file. Then you can decide whether to start a parser for
> the
> data in the stream file or not. Procedure http_parse_xml_stmf() is used
> for
> that purpose. It takes the name of an existing stream file and the
> address
> of the callback procedure to use. Then it starts the eXpat parser and
> the
> parser will call the callback procedure for each element it reads from
> the
> stream file.
> 
>> - Lastly, your example in HTTPXMLR4 seems to contain both HTTP POST as
>> well as EXPAT parsing. Is that correct?
> 
> As Scott already mentioned, HTTPXMLR4 is part of the HTTP API service
> program. It is not an example program. The following sample programs
> demonstrate how to use http_url_post_xml()/http_post_xml():
> 
>    EXAMPLE16 - UPS package tracking
>    EXAMPLE18 - Currency converter
>    EXAMPLE19 - Language translation
>    EXAMPLE20 - Currency converter (long SOAP action)
> 
> Thomas.
> 
> 
> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 28.08.2009 00:18:13:
> 
>> Von:
>>
>> KTirumamidi@xxxxxxxxxxxxxxx
>>
>> An:
>>
>> ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>>
>> Datum:
>>
>> 28.08.2009 00:22
>>
>> Betreff:
>>
>> Re: Missing tags in the web service XML creation
>>
>> Gesendet von:
>>
>> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>>
>> Scott - Upon reading the articles I am leaning towards your idea.
>>
>> - If it is worth a question can you please tell me how different is
>> EXPAT compared to IBM supplied XML-SAX parser? I just started reading
>> documentation on IBM for XML parsing.
>>
>> - I am trying to understand your sample programs in LIBHTTP and find
>> which is going to be the version I should use as there seems to be
>> different methods of XML parsing in there.
>>
>> - Also I do not know if I can use SOAPUI since our company has already
>> developed a generic RPG application to generate a XML file to POST to
>> the web service. Would that cause any issues in using your EXPAT
> utility
>> to parse the response file?
>>
>> - Lastly, your example in HTTPXMLR4 seems to contain both HTTP POST as
>> well as EXPAT parsing. Is that correct?
>>
>> Thanks advance,
>>
>> Regards
>> Kalyan
>>
>>
>>
>> Message: 1
>> Date: Thu, 27 Aug 2009 12:46:34 -0500
>> From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
>> Subject: Re: Missing tags in the web service XML creation
>> To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
>> Message-ID: <4A96C67A.4010103@xxxxxxxxxxxxxxxx>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Hello,
>>
>>> Here is what is happening. The tags between <q0:paymentRequest> and
>>> </q0:paymentRequest> are not being generated.
>> I just want to point out that you can use HTTPAPI with SoapUI. To get
>> this service working.  It's a little more effort than using WSDL2RPG,
>> but if you have a looming deadline, this might get you going quicker
>> than waiting for Thomas to update WSDL2RPG.
>>
>> Surely doing that is 100 times simpler than switching to another
>> technology like MQ!
>>
>>
>> -----------------------------------------
>> This e-mail, including attachments, may include confidential and/or
>> proprietary information, and may be used only by the person or
>> entity to which it is addressed. If the reader of this e-mail is
>> not the intended recipient or his or her authorized agent, the
>> reader is hereby notified that any dissemination, distribution or
>> copying of this e-mail is prohibited. If you have received this
>> e-mail in error, please notify the sender by replying to this
>> message and delete this e-mail immediately.
>>
> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>>
> -----------------------------------------------------------------------
> 
> 
> --
> IMPORTANT NOTICE:
> This email is confidential, may be legally privileged, and is for the
> intended recipient only. Access, disclosure, copying, distribution, or
> reliance on any of it by anyone else is prohibited and may be a criminal
> offence. Please delete if obtained in error and email confirmation to
> the sender.
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Fri, 28 Aug 2009 11:41:54 -0500
> From: Mohamed Musthafa Safarulla <mohamedmusthafa.safarulla@xxxxxxxxx>
> Subject: Re: No SOAP input for WS!
> To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Message-ID:
> 	<ffab07660908280941x3d11bfe8k98aeb9872f9db789@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Sorry. The code i posted i was trying all combination to see if it
> works.
> Actually the program had serviceXML elements wraps everything. Sorry for
> the
> confusion.
> 
> Thanks,
> Musthafa
> 
> On Thu, Aug 27, 2009 at 4:07 PM, Scott Klement
> <klemscot@xxxxxxxxxxxx>wrote:
> 
>>   Hello,
>>    > WS works fine when we call it from the WS testing utility but the
> WS
>>   > expert removed the header and methode name element from the SOAP
> to
>>   > make it work in that utility. Just used the basic XML data input
>>   > element to test it. WSDL is attached.
>>    The XML document from your debug log and RPG code is not the same
> as
>>   the one in this WSDL.  The WSDL wants it to look like this:
>>   <SOAP:Envelope
>>   xmlns:SOAP=[1]"http://schemas.xmlsoap.org/soap/envelope/";
>>                  xmlns:tns=[2]"http://tempuri.org/";>
>>      <SOAP:Header/>
>>      <SOAP:Body>
>>         <tns:CalculateTransitDates>
>>            <tns:serviceXML> your-value here </tns:serviceXML>
>>          </tns:CalculateTransitDates>
>>      </SOAP:Body>
>>   </SOAP:Envelope>
>>    Your code doesn't have <tns:serviceXML> -- instead it has
>>   tns:ServiceDS and tns:ServiceParam.  These aren't defined anywhere
> in
>>   the WSDL.  One wonders where you got the SOAP that you are passing
> to
>>   the web service?  Because it sure doesn't look like the SOAP that
> the
>>   WSDL expects.
>>
>> References
>>
>>   1. http://schemas.xmlsoap.org/soap/envelope/
>>   2. http://tempuri.org/
>>
> -----------------------------------------------------------------------
>> 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
-----------------------------------------------------------------------