Highlighted
Absent Member.
Absent Member.
6380 views

Consuming a WCF Service Created in .NET 4.5 in Visual COBOL.

Jump to solution

Hi 
Our Objective is to consume the WCF Service Created in .NET 4.5.

We are trying to Consume the Same WCF Service in Visual COBOL.

As per my initial understanding, To achieve this in Visual COBOL, We have couple of questions:

1.  Can we consume the WCF Service(.NET 4.5) in NATIVE project created in Visual COBOL?

      If Yes ?  Then how to do that? Some Example of thread will help us.

2. Can we consume the WCF service(.NET 4.5) in Managed project created in Visual COBOL?.

    If Yes ? Then How? Some Example or thread will help us.

Thanks

Charan

0 Likes
15 Replies
Highlighted
Absent Member.
Absent Member.
I need to transmit a Signed XML to an autarchy, and wait for the answer, but to connect in that autarchy I need to use the same digital certificate. I already do this in NetExpress 3.1, however I can not use the digital certificate to connect, as we are migrating to Visual Studio for visual cobol I am already thinking and doing for that version. but I found nothing about it.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
Are you sure you want to use WCF? Is the web service you're connecting to actually a WCF service?

You may want to review this discussion:
community.microfocus.com/.../
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
In another topic, Renato asked: "today I already sign the XML with digital certificate using a .NET class and I have a program in NetExpress 3.1 that does the transmission, however, when I will transmit the XML to connect in the Web Service I need the same digital certificate".

The .NET Framework HttpWebRequest class supports TLS and lets the client set the client certificate. Use WebRequest with an "https" URL to create the HttpWebRequest object, cast it to the HttpWebRequest type, and set its ClientCertificates property to an X509CertificateCollection containing your certificate. You should be able to find examples online.

It's also possible to do this with the newer HttpClient and HttpRequestMessage classes, but it requires creating an HttpRequestHandler and (in managed COBOL) using the ContinueWith method and a delegate, as shown in Ted John's method in the other topic. I don't recommend this approach.
0 Likes
Highlighted
Absent Member.
Absent Member.
Sorry, I had posted the wrong conversation...
Good morning, let me try to explain, today I already sign the XML with digital certificate using a .NET class and I have a program in NetExpress 3.1 that does the transmission, however, when I will transmit the XML to connect in the Web Service I need the same digital certificate that I signed, when I sign I already choose the digital certificate that I want to use, but I can not do it for transmission. In short, I need a .NET class that makes that connection using the same certificate, pass it on and get the answer. Thank you.
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.