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
Hi Charan,
In a native COBOL project you can consume Web Services by using the IMTK, Client Generation tool if you have a WSDL file for the Web Service. For a WCF Web Service you can obtain the WSDL by adding ?wsdl to the address of the service:
Not all wsdls are supported.
To use the client generation tool from within the IDE you would select Tools-->Micro Focus COBOL-->Generate Client From WSDL.
For managed code there is no problem. If you have a managed code project you can simply right click on the project name and select Add Service Reference and navigate to the service using it's URL if it is not on the development machine or you can use Discover to locate services that are local.
This will then generate the required class that can then be instantiated from your client code and you can call the methods on this object.
There are a number of examples in the Samples Browser for WCF under the category Windows Communication Foundation in the left hand window.
There is also a tutorial in the docs for WCF here:
Thanks.
                
     
                                    
            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
Hi Chris,
Thanks for the reply.
Consuming WCF from Visual COBOL managed Code is clear to me and I am able to consume the WCF from Managed Code.
For Native Code i have used the Tools-->Micro Focus COBOL-->Generate Client From WSDL option.
I need an WSDL file as input to generate the Client. 
There are two types of WCF I have to consume in Native Code.
1.  .NET WCF which are hosted with HTTP protocol , I am able to get the WSDL file after appending ?WSDL in the URL. 
And then used the option to generate the Client from WSDL,  It generates an application with 3 components in it :- Proxy COBOL program, Copybook and Application Program to call the Proxy COBOL program.
And when i run it it works fine and able to make a call to .NET WCF and get the output.
2. .NET WCF which are hosted with TCP/IP protocol, In this case I am not able to get the WSDL file after appending ?WSDl in the URL.
By making some changes at .NET WCF's config file we are able to generate the WSDL file.
Then I have generated the Client using WSDL, It generates 3 components same as above,
But when I try to run it , it is asking for Service address and when i provide the Netcp address its not able to make a call to WCF and i am getting error code "0017 - No User data after transformation".
Let us know your thoughts for the same and where we are making mistake.
Regards,
Charan
                
     
                                    
            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
It doesn't sound as if the WSDL generated by (2) above created a valid client. As I stated earlier, the native client generation does not work with all WSDL files especially those from WCF services. If you cannot generate a native client but you can generate a managed client then you might look at calling the managed client from the native program through COM Interop.
To test that the WSDL itself is valid you should download a tool such as SoapUI and import the WSDL there and try to run its client. If it works in SoapUI then it should probably also work in our client generator and then we could look into possible differences. If it also doesn't work in SoadUI then there is most likely a problem with the WSDL itself.
                
     
                                    
            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
Yes Chris,
It seems there is some problem with the WSDL for TCP/IP Hosted WCF. I will see if that can be corrected.
Apart from using Generate the Client using WSDL option and  Using WCF in Managed Code and calling it from Native program VIA COM Interop.
Is there any other way to consume the WCF in Native Code ?
Let me know if there is any other option to consume WCF in Native Code.
Thanks a lot.
Charan
                
     
                                    
            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
I do not know of another way to consume the WCF service other than the two approaches you mention here.
I have added an example to your other posts which shows how to get the COM approach working.
                
     
                                    
            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
Thanks Chris!!!
                
     
                                    
            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
Chris,
I am able to successfully consume WCF in the Native code Via Generate Client Using WSDL tool.
There are two COBOL programs and One Copybook is created using WSDL.
The Proxy Program which contains the Entry point for all WCF methods.
The Application program to consume the Proxy and Copy book to interact with WCF.
I have a small query regarding two Entry Point present in Proxy Program.
There are two Entry Points for set User ID and Password. What is the purpose or use of those two Entry points.
Because those are optional ...If we don't provide any password or user id, We are still able to call the wcf service and proxy program is able to make a call to WCF methods.
So what is the purpose of them and when we should use it.
Please let us know about the same.
Thanks
Charan
                
     
                                    
            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
The userid and password fields if specified, will be passed as part of the SOAP message in order to do basic Web Service authentication if your Web Service supports this.
If you do not require basic authentication then these can be ignored.
                
     
                                    
            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
Thanks Chris!!!
                
     
                                    
            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
Please there is some example of how to consume webservice, I use visual cobol for visual studio 4.0.
Thank you
                
     
                                    
            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
Hi Renato,
What type of Web Service are you trying to consume?
There is a demo in the Samples Browser of consuming a WCF Web Service. Look under Managed Code-->WCF-->WCF Airport Demo.
There is also a tutorial that you can run thru here:
                
     
                                    
            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
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.
                
     
                                    
            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
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/.../
                
     
                                    
            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
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.
                
     
                                    
            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
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.