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

Re: Question on using the HTTPAPI to receive a GUID



   Note: in the most recent releases of HTTP API, the webforms_xxxx()
   procs have been renamed�http_url_encoder_xxxxx(); simply leave out the
   /DEFINE WEBFORMS in your code.� The procedures were originally
   designed (named) to fill in webforms designed for human interaction.�   As opposed to a true web service.
   Do you have an example of what your request is supposed to look like?�   How does it compare to what you are sending?
   In the data you show, it appears you've duplicated part of the URI
   �  uri =
   '[1]https://ecolabservicewebapp.azurewebsites.net/api/EndService'
   'Message/GetMessages?StartTime=StartTime=2016-03-21T19%3A20%3'
   'A02-05%3A00&InstanceId=uk&InstanceId=StartTime=2016-03-21T19'
   '%3A20%3A02-05%3A00&
   �th a rest service, you should be able to copy the example URI �to
   a browser and get a valid response.
   Charles
   On Tue, Mar 22, 2016 at 8:44 PM, Baeten, John
   <[2]John.Baeten@xxxxxxxxxx> wrote:

     Thank you Charles for the extra information regarding the GUID.� I
     did understand some things about it, but from what I am
     understanding once I am able to get the XML parsed out into the
     iSeries I will be using that value to send to the next URL that will
     be giving me the actual data back in XML format.� The GUID XML will
     have 0 to x+ nodes depending on how many different sets of XML I
     will be needing to download in the next step.
     Scott,
     Thank you for your comment also.� I was also hoping this would be
     an easy process of receiving the XML that would contain the GUID
     that I will need to use in the following URL call to actually get
     the XML data.� There really is no documentation relating to the
     process yet, as another part of our company is working on the SQL
     server side and I am just working on getting data to them, hopefully
     and back again.
     The XML that I will be receiving looks like this:
     <ArrayOfguid><guid>07ceac4b-52be-4f03-be21-32b77b92301d</guid></Arra
     yOfguid>
     I might have had trouble with the example from the LIBHTTP library
     because as I found out today in talking to the group that created it
     the URL is now broken and is not returning the correct XML.� The
     method I need to use is to call a REST web service.� The example of
     the program I found that I think closely resembles what I need to do
     from the library LIBHTTP examples is EXAMPLE12- Example of working
     with cookies, the other choice was EXAMPLE13-Example of Download
     Currency Exchange Rates (REST).� I did choose EXAMPLE12 because in
     my URL string I also needed to send it a timestamp and other code
     that is used to get me the correct GUID XML.� Which in this example
     also sends data to the URL as ?query=.
     Again, I do not know if my change to the program works or does not
     work because the URL is currently broken.� I am wondering if I am
     on the correct track of using an existing example program to change
     to do what I need to happen.� From the example I did not know if I
     need to keep (but I did and changed):
     form = webform_open();
     webform_setVar(form: 'StartTime': %Trim(wrkts));
     webform_setVar(form: 'InstanceId': 'uk');
     uri = '[3]https://xxxservicewebapp.xxxwebsites.net/api/+
     � � � �EndServiceMessage/GetMessages+
     � � � �?StartTime=' + webform_getData(Form)+
     � � � �'&InstanceId=' + webform_getData(Form);
     webform_close(form);
     when I run this part of the program it creates:

   �
     uri =
     '[4]https://ecolabservicewebapp.azurewebsites.net/api/EndService'
     'Message/GetMessages?StartTime=StartTime=2016-03-21T19%3A20%3'
     'A02-05%3A00&InstanceId=uk&InstanceId=StartTime=2016-03-21T19'
     '%3A20%3A02-05%3A00&InstanceId=uk� � � � � � � � � � � �     � � '
     And I get the following error after it runs:
     rc = http_url_get_xml( uri: *null: %paddr(parseXML): *null);
     if (rc <> 1);
     � � �http_crash();
     endif;
     HTTP/1.1 500 Internal Server Error
     The program has not run correctly yet, so for the parsing of the XML
     I have not been able to start that as I do not know what the results
     will give me back for the path and also the name field values.� I
     have left it as the way the example program has it set up (I do
     understand this is the wrong data it is looking for).� While in
     debugging the program the PATH = '/html/head' and '/html'.� Then
     the program errors with the above error.
     I guess to sum this all up, I am very new at consuming web services
     and I would like to know based on the example program that I am
     using and also the changes I have made to it if I am on the correct
     track to solve this programming issue.� Web services seem very
     interesting and this is the first time I have ever seen/used them.
     Again, any help would be greatly appreciated in working with the
     example program to complete this part of the project that I am
     working on.
     Thanks,
     John

References

   1. https://ecolabservicewebapp.azurewebsites.net/api/EndService
   2. mailto:John.Baeten@xxxxxxxxxx
   3. https://xxxservicewebapp.xxxwebsites.net/api/+
   4. https://ecolabservicewebapp.azurewebsites.net/api/EndService
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------