Skip to main content

Hello,

I am integrating our application with an existing online application and I have the following problem:
Communication is done correctly and the response comes in JSON format.

When I make the request and the response has only one record, I've already been able to access the data for that record.
The problem occurs with the execution of the instruction and the answer is several registers. The example is importing existing reservations in the online application and the answer is four records.
I cannot convert this data to four records that can be "worked".

In this case I'm using the RestSharp interface
Once again, I ask for your help in solving this problem. 

If you want, I can send the example I'm using.

Best regards

Alberto Ferraz

Hello,

I am integrating our application with an existing online application and I have the following problem:
Communication is done correctly and the response comes in JSON format.

When I make the request and the response has only one record, I've already been able to access the data for that record.
The problem occurs with the execution of the instruction and the answer is several registers. The example is importing existing reservations in the online application and the answer is four records.
I cannot convert this data to four records that can be "worked".

In this case I'm using the RestSharp interface
Once again, I ask for your help in solving this problem. 

If you want, I can send the example I'm using.

Best regards

Alberto Ferraz

I have never used the RestSharp API but I will take a look if you can show me an example of where the problem is...


I have never used the RestSharp API but I will take a look if you can show me an example of where the problem is...

Hi Chris, tanks for your help.

How can i send you a demo program to verify de problem?


Hi Chris, tanks for your help.

How can i send you a demo program to verify de problem?

If it is small enough you can zip it up and email it to me at chris.glazier@microfocus.com. If that doesn't work we can try our ftp site.


If it is small enough you can zip it up and email it to me at chris.glazier@microfocus.com. If that doesn't work we can try our ftp site.

Hi Chris,

I have already sent the project by mail. 
I think you should have already received it. I sent it from my personal email because the business was sending an error. I think that with what I sent I will be able to try to understand my problem.
If anything else is needed, please let me know. Thanks again.

Best regards
Alberto Ferraz

Hi Chris,

I have already sent the project by mail. 
I think you should have already received it. I sent it from my personal email because the business was sending an error. I think that with what I sent I will be able to try to understand my problem.
If anything else is needed, please let me know. Thanks again.

Best regards
Alberto Ferraz

I have not yet received anything from you.

Please upload the file to our ftp site and let me know when it is there.

FTP site:
https://amerftp.microfocus.com

Customer Login:
User:
sline_upload
passwd:
MFupload007

Thanks.


I have not yet received anything from you.

Please upload the file to our ftp site and let me know when it is there.

FTP site:
https://amerftp.microfocus.com

Customer Login:
User:
sline_upload
passwd:
MFupload007

Thanks.

Hi Chris,

I've already uploaded it via FTP and sent an email with the information and without 
the .zip file (you may be able to receive it this way).

File name: TesteCampingCare.zip I await your news.

Best regards
Alberto Ferraz

I have not yet received anything from you.

Please upload the file to our ftp site and let me know when it is there.

FTP site:
https://amerftp.microfocus.com

Customer Login:
User:
sline_upload
passwd:
MFupload007

Thanks.

Hi Chris,

I've already uploaded it via FTP and sent an email with the information 
and without the .zip file (you may be able to receive it this way).

File name: TesteCampingCare.zip
I await your news.

Best regards

Alberto Ferraz


Hi Chris,

I've already uploaded it via FTP and sent an email with the information 
and without the .zip file (you may be able to receive it this way).

File name: TesteCampingCare.zip
I await your news.

Best regards

Alberto Ferraz

I have received the zip file and your email. I am looking into the issue today,

Thanks


I have received the zip file and your email. I am looking into the issue today,

Thanks

The error actually occurs in the declaration of the response object. If you step on that line in the debugger and hover over it you will see that the exception first occurred there.

It appears to have to do with defining the generic List with the type Root which is a class that you are defining.

If I change references from type Root to type String it all seems to work ok.

I don't know enough about this RestSharp API to determine the cause yet because I dont know what it is expecting for deserialization.

This code works:

                   invoke request::AddHeader("Authorization", "Bearer MjE0MV80Njc3OV9QVlN0bnlLV0tZWVFyZGVaQzVFYUFHNTJONEh3d2VFQQ==")
                   declare response as type IRestResponse = client::Execute[type String](request)

           *> PLACE TO DESCRIBE THE SOLUTION - RUN TIME ERROR IN LINE 84

                   declare deserialba as type JsonDeserializer = new JsonDeserializer()
                   declare messageList2 as type List[type String] = deserialba::Deserialize[type List[type String]](response) 
              *> PLACE TO DESCRIBE THE SOLUTION - RUN TIME ERROR IN LINE 84

I will keep looking but perhaps you can take a look at the Root class and see what could be wrong?


The error actually occurs in the declaration of the response object. If you step on that line in the debugger and hover over it you will see that the exception first occurred there.

It appears to have to do with defining the generic List with the type Root which is a class that you are defining.

If I change references from type Root to type String it all seems to work ok.

I don't know enough about this RestSharp API to determine the cause yet because I dont know what it is expecting for deserialization.

This code works:

                   invoke request::AddHeader("Authorization", "Bearer MjE0MV80Njc3OV9QVlN0bnlLV0tZWVFyZGVaQzVFYUFHNTJONEh3d2VFQQ==")
                   declare response as type IRestResponse = client::Execute[type String](request)

           *> PLACE TO DESCRIBE THE SOLUTION - RUN TIME ERROR IN LINE 84

                   declare deserialba as type JsonDeserializer = new JsonDeserializer()
                   declare messageList2 as type List[type String] = deserialba::Deserialize[type List[type String]](response) 
              *> PLACE TO DESCRIBE THE SOLUTION - RUN TIME ERROR IN LINE 84

I will keep looking but perhaps you can take a look at the Root class and see what could be wrong?

I've been replacing the fields according to your indication but it's also 
not possible to change the options of "Root" to "string".
The variable "messagelist2" later is not compatible with the data to be searched. I was also looking at the "root" class and didn't find anything wrong
(in fact that class was created automatically from the registry variables
to be imported). And I think that the class is ok because in the first part of the program
When "BR" ("Get Reservation" option), the request imports only one record
and in this case there is no problem. The problem has to do with the issue of having to read multiple registers. I will continue to try to find something out. Thank you for taking the time to do this. You may still be able to resolve that.