Skip to main content

Hi,

I have to integrate my invoicing application with a cash payment device (CASH DRO3).

I still can't understand how I get the result of the operation in JSON format.
I ask for your help once again to try to overcome this situation.
I have the supplier's instructions but I can't send them through this post.
Best regards
Alberto Ferraz

Hi,

I have to integrate my invoicing application with a cash payment device (CASH DRO3).

I still can't understand how I get the result of the operation in JSON format.
I ask for your help once again to try to overcome this situation.
I have the supplier's instructions but I can't send them through this post.
Best regards
Alberto Ferraz

You will have to provide more detail than this I'm afraid.

Are you using native COBOL or managed .NET or JVM?
Is the 3rd party software written in a native or managed language?

What does the call interface look like for the function you are trying to call?

Are the instructions available on the internet where you could provide a link?


You will have to provide more detail than this I'm afraid.

Are you using native COBOL or managed .NET or JVM?
Is the 3rd party software written in a native or managed language?

What does the call interface look like for the function you are trying to call?

Are the instructions available on the internet where you could provide a link?

I am using VB Cobol in native.
I don't know if it will be necessary to use .NET for this functionality.

The communication to be developed via webservices is with a cash receiving equipment, 
equipment to which i have to send the invoice amount and, after the customer pays,
i have to receive a response (in JSON format) with a status.

I'm going to send the complete manual via that site you referred me to last time (amerftp.microfocus.com/).
The name of the document is CashDroWebService.pdf.

Thanks.
Best regards
Alberto Ferraz
 

I am using VB Cobol in native.
I don't know if it will be necessary to use .NET for this functionality.

The communication to be developed via webservices is with a cash receiving equipment, 
equipment to which i have to send the invoice amount and, after the customer pays,
i have to receive a response (in JSON format) with a status.

I'm going to send the complete manual via that site you referred me to last time (amerftp.microfocus.com/).
The name of the document is CashDroWebService.pdf.

Thanks.
Best regards
Alberto Ferraz
 

What version of Visual COBOL are you using?

The Visual COBOL IMTK (Interface Mapping Toolkit) provides support for generating client programs that will call a web service directly from a WSDL file, JSON Schema file or OpenAPI (Swagger) file. If you have one of these files then the generated client program will handle the parameter passing and parsing of the return parameters so you don't have to deal with it you can then incorporate the is client program into your own application.

You should take a look at the entire section of documentation here:

or here:


What version of Visual COBOL are you using?

The Visual COBOL IMTK (Interface Mapping Toolkit) provides support for generating client programs that will call a web service directly from a WSDL file, JSON Schema file or OpenAPI (Swagger) file. If you have one of these files then the generated client program will handle the parameter passing and parsing of the return parameters so you don't have to deal with it you can then incorporate the is client program into your own application.

You should take a look at the entire section of documentation here:

or here:

I am using version 3.0 as 6.0 had an incompatibility issue with my application.
Microfocus told me they have fixed the issue but I still haven't reinstalled 6.0 
again.

Now that the season is over and I don't need to mess with the application, I'll try again. Regarding the options you indicated, I'm going to read the tutorials and then I'll say something. Thanks again.

I am using version 3.0 as 6.0 had an incompatibility issue with my application.
Microfocus told me they have fixed the issue but I still haven't reinstalled 6.0 
again.

Now that the season is over and I don't need to mess with the application, I'll try again. Regarding the options you indicated, I'm going to read the tutorials and then I'll say something. Thanks again.

Hello,

I return to this subject after almost a year because I will now resume this project.
I already have VB 6.0 running and so this is the version I have.
What I need to start is to "translate" this command to Cobol:
"192.168.13.168/.../index.php
&posid=terminal2&posuser=Maria&parameters={"amount":"100"}"

and the Json return could be "{"code":1,"data":"452"}"

I already managed to convert Json data in another project but it was a specific thing. 
I can try the same solution to convert it, but for now, I need to be able to send the command via webservice.
Thanks again.

Best regards
Alberto Ferraz


Hello,

I return to this subject after almost a year because I will now resume this project.
I already have VB 6.0 running and so this is the version I have.
What I need to start is to "translate" this command to Cobol:
"192.168.13.168/.../index.php
&posid=terminal2&posuser=Maria&parameters={"amount":"100"}"

and the Json return could be "{"code":1,"data":"452"}"

I already managed to convert Json data in another project but it was a specific thing. 
I can try the same solution to convert it, but for now, I need to be able to send the command via webservice.
Thanks again.

Best regards
Alberto Ferraz

The command i need:

Best regards

Alberto Ferraz


The command i need:

Best regards

Alberto Ferraz

Hi Alberto.

Did you look at the tutorials for REST web services that I mentioned previously in this thread?

If you have a JSON schema file that describes this web service (file with .json extension) you can import it into the imtk tool in Visual COBOL and it will generate a COBOL client program that will accept input parameters and then send the request and then return a set of output parameters. You wouldn't have to deal with the JSON at all. 

Is this what you are looking for?


Hi Alberto.

Did you look at the tutorials for REST web services that I mentioned previously in this thread?

If you have a JSON schema file that describes this web service (file with .json extension) you can import it into the imtk tool in Visual COBOL and it will generate a COBOL client program that will accept input parameters and then send the request and then return a set of output parameters. You wouldn't have to deal with the JSON at all. 

Is this what you are looking for?

Hi Chris,

Thanks for your availability.

I actually read the documentation you mention but, due to difficulties in knowing this type of programming, I couldn't understand much.
What I really need for now is how to access the equipment via webservice, that is, what instructions do I have to do to access "">192.168.13.168/.../etc".
I think that if I can send the webservice request, I'll be able to later try to process the response.
Regarding the schema of the .json file, I have already asked the supplier if he has it to send me.

Thank you once again for your help.

Best regards
Alberto Ferraz

Hi Chris,

Thanks for your availability.

I actually read the documentation you mention but, due to difficulties in knowing this type of programming, I couldn't understand much.
What I really need for now is how to access the equipment via webservice, that is, what instructions do I have to do to access "">192.168.13.168/.../etc".
I think that if I can send the webservice request, I'll be able to later try to process the response.
Regarding the schema of the .json file, I have already asked the supplier if he has it to send me.

Thank you once again for your help.

Best regards
Alberto Ferraz

There is no simple command in native COBOL that you can use to send and receive a web service request/response. We do provide a tool that can be run from within a VC command prompt that will generate a client program from the json schema file, that you can incorporate into your own code. This program will call the web service and handle the sending and receiving parameters for you. 

The command is:

imtkmake -genclientjson clientjson=<jsonfile.json>

where <jsonfile.json> will be the name of your json schema file that is provided by the 3rd party. 

You can also access the web service using .NET classes link HttpClient but I don't currently have an example to show you. It is more complex than simply generating a COBOL client using imtkmake.


There is no simple command in native COBOL that you can use to send and receive a web service request/response. We do provide a tool that can be run from within a VC command prompt that will generate a client program from the json schema file, that you can incorporate into your own code. This program will call the web service and handle the sending and receiving parameters for you. 

The command is:

imtkmake -genclientjson clientjson=<jsonfile.json>

where <jsonfile.json> will be the name of your json schema file that is provided by the 3rd party. 

You can also access the web service using .NET classes link HttpClient but I don't currently have an example to show you. It is more complex than simply generating a COBOL client using imtkmake.

Hi Chris,

I've already been reviewing the issue of REST for WebServices and I think I've managed to understand its logic. 
I've also managed to convert the Json data.
I did some experiments with a simple webservice (going to get the company
name and address through its VAT number) and it worked.

Now I'm going to start working on connecting to the equipment I need.

If I ever need anything, I count on your precious help once again.

Thanks

Best regards
Alberto Ferraz