[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question on using the HTTPAPI to receive a GUID
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></ArrayOfguid>
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 = '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 =
'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
Message: 1
Date: Tue, 22 Mar 2016 02:29:05 +0000
From: "Baeten, John" <John.Baeten@xxxxxxxxxx>
To: "ftpapi@xxxxxxxxxxxxxxxxxxxxxx" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Question on using the HTTPAPI to receive a GUID
Message-ID:
<BLUPR0601MB09622F949138CA0739C492B387800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
I have a question that I am hoping someone out there has done before or can point me in the correct direction. At our company we need to send data to a new SQL server database that will take the formatted data as XML by doing a POST to a web service URL address. Our iSeries is at V7R1M0.
To create the XML we are using the CGIDEV2 to create our XML by using templates. And this part is working great to create the XML with no issues. Then to perform the POST to the URS we are using the HTTPAPI from Scott Klement. This part is also working great.
We now need to get data back from the SQL server. The issues is we need to POST to a URL which will give us back a GUID. This GUID will be used to do another POST to retrieve the XML from the SQL server database that will be processed in our back end programs on the iSeries.
I am not sure if the HTTPAPI allows retrieving a GUID. I have done numerous searches online and I have not found anything relating to how to make this work. So I am asking if anyone knows how to do this, or could point me in the right direction of some other API or process to make this work for us.
Thank you for your help,
John
CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may contain proprietary and privileged information for the use of the designated recipients named above. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
-------------- next part --------------
I have a question that I am hoping someone out there has done before or
can point me in the correct direction. At our company we need to send
data to a new SQL server database that will take the formatted data as
XML by doing a POST to a web service URL address. Our iSeries is at
V7R1M0.
To create the XML we are using the CGIDEV2 to create our XML by using
templates. And this part is working great to create the XML with no
issues. Then to perform the POST to the URS we are using the HTTPAPI
from Scott Klement. This part is also working great.
We now need to get data back from the SQL server. The issues is we
need to POST to a URL which will give us back a GUID. This GUID will
be used to do another POST to retrieve the XML from the SQL server
database that will be processed in our back end programs on the
iSeries.
I am not sure if the HTTPAPI allows retrieving a GUID. I have done
numerous searches online and I have not found anything relating to how
to make this work. So I am asking if anyone knows how to do this, or
could point me in the right direction of some other API or process to
make this work for us.
Thank you for your help,
John
CONFIDENTIALITY NOTICE: This e-mail communication and any attachments
may contain proprietary and privileged information for the use of the
designated recipients named above. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy all
copies of the original message.
------------------------------
Message: 2
Date: Mon, 21 Mar 2016 22:39:04 -0500
From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Question on using the HTTPAPI to receive a GUID
Message-ID: <56F0BE58.4080909@xxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset=windows-1252; format=flowed
John,
If I understand you correctly, the site is just returning a GUID (global unique ID) instead of the result. A GUID is just a character string with a unique identifier in it. So you just get back this string, and
then make another request with the GUID to get the result. I haven't
done it, but based on your description, it sounds very simple.
I doubt very much that someone else has done exactly what you're trying to do here, since this is not a commonplace thing, and it's unlikely that someone would've done it with the exact syntax that your server is using, as your server sounds like it's doing something rather custom.
Can't you just try a few requests and see what it's returning and figure
it out? Is there no documentation or explanation anywhere for this SQL
server web service you're working with?
-SK
On 3/21/2016 9:29 PM, Baeten, John wrote:
> I have a question that I am hoping someone out there has done before or
> can point me in the correct direction. At our company we need to send
> data to a new SQL server database that will take the formatted data as
> XML by doing a POST to a web service URL address. Our iSeries is at
> V7R1M0.
>
>
> To create the XML we are using the CGIDEV2 to create our XML by using
> templates. And this part is working great to create the XML with no
> issues. Then to perform the POST to the URS we are using the HTTPAPI
> from Scott Klement. This part is also working great.
>
>
> We now need to get data back from the SQL server. The issues is we
> need to POST to a URL which will give us back a GUID. This GUID will
> be used to do another POST to retrieve the XML from the SQL server
> database that will be processed in our back end programs on the
> iSeries.
>
>
> I am not sure if the HTTPAPI allows retrieving a GUID. I have done
> numerous searches online and I have not found anything relating to how
> to make this work. So I am asking if anyone knows how to do this, or
> could point me in the right direction of some other API or process to
> make this work for us.
>
>
> Thank you for your help,
>
>
> John
>
------------------------------
Message: 3
Date: Tue, 22 Mar 2016 09:27:01 -0400
From: Charles Wilt <charles.wilt@xxxxxxxxx>
To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Question on using the HTTPAPI to receive a GUID
Message-ID:
<CAJ=Tnc5GSKou4M0bzssH3-nFEHrwQ8TYK8=QZ1NNUc1mF=QCuw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"
GUID's are 128bit (16 byte) integer values...
However, 8 byte integers are the largest most systems support. So GUIDs are normally treated as a 16 byte binary string.
When passing between systems, they are usually passed as a human readable hexadecimal string of either 32 bytes (no dashes) or 36 bytes (with dashes) x'c67c7891-267b-42fc-a5da-2ebd30b566fc'
You'll have to see what the web server is returning and simply pass it back in your next request.
If the web service is using a 16 byte binary string, be careful that you don't try to translate it into EBCDIC.
Charles
On Mon, Mar 21, 2016 at 10:29 PM, Baeten, John <John.Baeten@xxxxxxxxxx>
wrote:
> I have a question that I am hoping someone out there has done before or
> can point me in the correct direction. At our company we need to send
> data to a new SQL server database that will take the formatted data as
> XML by doing a POST to a web service URL address. Our iSeries is at
> V7R1M0.
>
>
> To create the XML we are using the CGIDEV2 to create our XML by using
> templates. And this part is working great to create the XML with no
> issues. Then to perform the POST to the URS we are using the HTTPAPI
> from Scott Klement. This part is also working great.
>
>
> We now need to get data back from the SQL server. The issues is we
> need to POST to a URL which will give us back a GUID. This GUID will
> be used to do another POST to retrieve the XML from the SQL server
> database that will be processed in our back end programs on the
> iSeries.
>
>
> I am not sure if the HTTPAPI allows retrieving a GUID. I have done
> numerous searches online and I have not found anything relating to how
> to make this work. So I am asking if anyone knows how to do this, or
> could point me in the right direction of some other API or process to
> make this work for us.
>
>
> Thank you for your help,
>
>
> John
>
>
> CONFIDENTIALITY NOTICE: This e-mail communication and any attachments
> may contain proprietary and privileged information for the use of the
> designated recipients named above. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply e-mail and destroy all
> copies of the original message.
>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
>
>
-------------- next part --------------
GUID's are 128bit (16 byte) integer values...
However, 8 byte integers are the largest most systems support.? So
GUIDs are normally treated as a 16 byte binary string.
When passing between systems, they are usually passed as a human
readable hexadecimal string of either 32 bytes (no dashes) or 36 bytes
(with dashes)
x'c67c7891-267b-42fc-a5da-2ebd30b566fc'
You'll have to see what the web server is returning and simply pass it
back in your next request.
If the web service is using a 16 byte binary string, be careful that
you don't try to translate it into EBCDIC.?
Charles
On Mon, Mar 21, 2016 at 10:29 PM, Baeten, John
<[1]John.Baeten@xxxxxxxxxx> wrote:
? ? I have a question that I am hoping someone out there has done
before or
? ? can point me in the correct direction. At our company we need
to send
? ? data to a new SQL server database that will take the formatted
data as
? ? XML by doing a POST to a web service URL address.? Our iSeries
is at
? ? V7R1M0.
? ? To create the XML we are using the CGIDEV2 to create our XML by
using
? ? templates.? And this part is working great to create the XML
with no
? ? issues.? Then to perform the POST to the URS we are using the
HTTPAPI
? ? from Scott Klement.? This part is also working great.
? ? We now need to get data back from the SQL server.? The issues
is we
? ? need to POST to a URL which will give us back a GUID.? This
GUID will
? ? be used to do another POST to retrieve the XML from the SQL
server
? ? database that will be processed in our back end programs on the
? ? iSeries.
? ? I am not sure if the HTTPAPI allows retrieving a GUID.? I have
done
? ? numerous searches online and I have not found anything relating
to how
? ? to make this work.? So I am asking if anyone knows how to do
this, or
? ? could point me in the right direction of some other API or
process to
? ? make this work for us.
? ? Thank you for your help,
? ? John
? ? CONFIDENTIALITY NOTICE: This e-mail communication and any
attachments
? ? may contain proprietary and privileged information for the use
of the
? ? designated recipients named above. Any unauthorized review,
use,
? ? disclosure or distribution is prohibited. If you are not the
intended
? ? recipient, please contact the sender by reply e-mail and
destroy all
? ? copies of the original message.
--------------------------------------------------------------------
---
This is the FTPAPI mailing list.? To unsubscribe, please go to:
[2]http://www.scottklement.com/mailman/listinfo/ftpapi
--------------------------------------------------------------------
---
References
1. mailto:John.Baeten@xxxxxxxxxx
2. http://www.scottklement.com/mailman/listinfo/ftpapi
------------------------------
Message: 4
Date: Tue, 22 Mar 2016 13:56:25 +0000
From: John Long <John.Long@xxxxxxxxxxxxxx>
To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Cannot get TLS 1.2 and SNI to work
Message-ID:
<9658ce5c9759402ea081f035c5ffafd4@xxxxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
Hi Scott,
I've thanks for the reply a few days ago, I know this is slightly outside the scope of the HTTPAPI, but it is also linked too, so please bear with me,
Some Background info :-
* The system it is running at 7.1 TR 007
* PTF SI48659 has been installed and the system IPL'd
* PTF SI48539 has been applied
* DCM is showing TLS 1.2 support.
When I try to change QSSLPCL it will not accept *TLSV1.2, the highest is *TLSV1.1, I receive the message "Specified value not allowed for system value QSSLPCL."
When I try and use HTTPAPI and set SNI, which I do have to use, I get a 701 error (I think this is the error number) , debugging shows it's an invalid attribute,
This to me is suggesting the GSKit is out of date, but I cannot see where or how to upgrade it.
How is the GSKit updated? How can I check which version I'm running?
Any suggestion, pointers etc would be extremely useful at this point
Regards,
John
_____________________________________________________________ T.J. MORRIS LTD-CONFIDENTIALITY NOTICE This e-mail and its contents, together with any attachments, are confidential to the sender and the intended recipient(s). If you are not the intended recipient or agent responsible for delivery to the intended recipient any unauthorised storage, use, disclosure, copying, distribution or dissemination of this e-mail or any part thereof is strictly prohibited and may be illegal. If you receive this e-mail in error please advise us by telephone on +44(0)151 530 2920 and delete and destroy this e-mail and any attachments and any copies thereof from your system immediately. Any views or opinions expressed in this e-mail are solely those of the sender and do not necessarily represent those of T J Morris Ltd. Although any attachments to this e-mail have been checked for viruses we make no representation and give no warranty as to the absence of viruses and you should scan this e-ma!
il and attachments for viruses. ___________________________________________________________
-------------- next part --------------
Hi Scott,
I've thanks for the reply a few days ago, I know this is slightly
outside the scope of the HTTPAPI, but it is also linked too, so please
bear with me,
Some Background info :-
? The system it is running at 7.1 TR 007
? PTF SI48659 has been installed and the system IPL'd
? PTF SI48539 has been applied
? DCM is showing TLS 1.2 support.
When I try to change QSSLPCL it will not accept *TLSV1.2, the highest
is *TLSV1.1, I receive the message "Specified value not allowed for
system value QSSLPCL."
When I try and use HTTPAPI and set SNI, which I do have to use, I get a
701 error (I think this is the error number) , debugging shows it's an
invalid attribute,
This to me is suggesting the GSKit is out of date, but I cannot see
where or how to upgrade it.
How is the GSKit updated? How can I check which version I'm running?
Any suggestion, pointers etc would be extremely useful at this point
Regards,
John
_____________________________________________________________ T.J.
MORRIS LTD-CONFIDENTIALITY NOTICE This e-mail and its contents,
together with any attachments, are confidential to the sender and the
intended recipient(s). If you are not the intended recipient or agent
responsible for delivery to the intended recipient any unauthorised
storage, use, disclosure, copying, distribution or dissemination of
this e-mail or any part thereof is strictly prohibited and may be
illegal. If you receive this e-mail in error please advise us by
telephone on +44(0)151 530 2920 and delete and destroy this e-mail and
any attachments and any copies thereof from your system immediately.
Any views or opinions expressed in this e-mail are solely those of the
sender and do not necessarily represent those of T J Morris Ltd.
Although any attachments to this e-mail have been checked for viruses
we make no representation and give no warranty as to the absence of
viruses and you should scan this e-mail and attachments for viruses.
___________________________________________________________
------------------------------
Message: 5
Date: Tue, 22 Mar 2016 09:30:53 -0500
From: David Lounsbrough <David.Lounsbrough@xxxxxxxxxx>
To: "'HTTPAPI and FTPAPI Projects'" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: FTP API Transfer Hanging
Message-ID:
<608EEAE35B91D94F8D546F8A343477C16E8CF04D7C@xxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
We are continuing to experience hanging transfers with the FTP API. I can't see anything that looks suspicious coming out of the job log, but I've attached the log and the call stack from the latest failure. The last entry in the log shows where the process is hanging. If this is network related, is there a way we can set a timeout for the transfer? Currently when we have a problem, the job just sits indefinitely waiting for the transfer to complete. Is there a way we can make the FTP API timeout after say 10 minutes so that we can then handle the failure programmatically?
Thanks.
-------------- next part --------------
We are continuing to experience hanging transfers with the FTP API. I
can't see anything that looks suspicious coming out of the job log, but
I've attached the log and the call stack from the latest failure. The
last entry in the log shows where the process is hanging. If this is
network related, is there a way we can set a timeout for the transfer?
Currently when we have a problem, the job just sits indefinitely
waiting for the transfer to complete. Is there a way we can make the
FTP API timeout after say 10 minutes so that we can then handle the
failure programmatically?
Thanks.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qsysprt.txt
URL: <http://scottklement.com/pipermail/ftpapi/attachments/20160322/0080de42/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qpjoblog.txt
URL: <http://scottklement.com/pipermail/ftpapi/attachments/20160322/0080de42/attachment-0001.txt>
------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list digest. To unsubscribe, go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
End of Ftpapi Digest, Vol 113, Issue 17
***************************************
CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may contain proprietary and privileged information for the use of the designated recipients named above. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------