Highlighted
Absent Member.
Absent Member.
2867 views

insert xml in a form

Please help me!

I have a comunication with web server, but the return this web server is xml, i need to know how i get xml and insert this xml in a form in Visual Cobol

Tags (1)
0 Likes
6 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: insert xml in a form

Can you please provide some more detail here?

What Visual COBOL product are you using Visual COBOL for Visual Studio or Visual COBOL for Eclipse?

Are you using native code or managed code (.NET or .JVM)

What form technology are you using?

Visual COBOL currently supports calling SOAP Web Services in native COBOL projects and client programs can be generated using the WSDL file from the web service.

In managed .NET code you can create and consume SOAP (ASP.NET) and WCF Web Services quite easily so that the data is returned using standard COBOL types and you do not have to concern yourself with the xml format at all.

Please take a look at the documentation here:

There are also examples of Web Services in the Samples Browser.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: insert xml in a form

Hello, Chris.

Thanks for answer.

I'm using Visual COBOL for Visual Studio.

I'm going to work SOAP, but i don't know to do this, my question is

how i do?

I read the document you sent me, but I need to know the syntax.

This my link i need to do

ws.dbdireto.com.br/.../Service.asmx

Thanks for your help.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: insert xml in a form

Hey, Chris.

I need to have something like this for visual cobol for windows

www.linhadecodigo.com.br/.../soap-e-webservices.aspx

Thanks

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: insert xml in a form

You can do exactly what is shown in that article.

I have attached an example containing a simple VC ASP.NET Web Service and a Winform client project that calls it and displays the returned value.

ASP.NET Web Services using SOAP are the older method of creating Web Services but they are still supported. You can create a new ASP.NET Web Service by selecting New-->Web Site-->ASP.NET Web Service. The newer method is using WCF and we have a number of examples that demonstrate this.

To call an ASP.NET Web Service from a client application right click on the project name in Solution Explorer and select Add Service Reference. If the Web Service is located on the same computer you can select Discover to find it. If it is on a different computer then you should place the URL to its WSDL file in the field provided. Once you have added the reference to the project you can instantiate the class and call its methods.

Thanks.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: insert xml in a form

Thanks, Chris.

i did download of vcwebservice.zip.

But i tried to run, but he gave error.

I took a screen shot -  www.dropbox.com/.../Capturar.PNG

so for you to know I do not have much experience in this matter, but thank you

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: insert xml in a form

Sorry about that. When I saved the solution file for these two projects it was saved to a folder outside of what I included in the zip file so it wasn't included.

I have attached a new zip file that contains the .sln.

Please unzip it to your C drive and then open up c:\vcwebservice.sln in Visual COBOL.

Thanks.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.