Consuming WCF in NAtive Code via Managed Code in Visual COBOL

Hi Chris,

The objective is to Consume the WCF Created in .NET 4.5 in Visual COBOL.(In Native Code VIA Managed Code)

To Do this I have followed following Steps:

1. Created an Managed Project in Visual COBOL, Added the Service Reference of .NET WCF. 

2. Selected the Property of Managed project as "Register for COM Interop". I am getting couple of Warning for the same. (Type Library exporter warning Generic Code may not exported to COM.)

3. Created an managed program to create an object of WCF Client Class and call the WCF methods.

3. Created an Native Project and added a Native Program.

4. Provide the Class Control section to point to the OLE object created by Managed Project.

5. Tried to Invoke the Managed Program of Managed Project from Native Program.

I am able to reach to the Managed Program (getting a display from there) But when managed program tries to call the WCF method , I am getting following error " Could not find the default endpoint element that references the contract "IService1". in the service model Client Configuration Section.

this might be because no configuration file was found for your application , or because no endpoint element matching this contract could be found in the client element".

Hope you are able to understand the problem, Let me know if you require any additional info. 

Let us know what can be possible problem in this approach.

Regards,

Charan

Parents
  • I think that we might have discovered a problem in the area of calling a WCF Service when passing certain types of parameters by value in and out of the interface. The error message that we are receiving is similar to the one you are receiving.

    Can you confirm what your service methods are using as parameters? The problem that we found occurs when trying to pass a data only object by value as a parameter in order to pass a COBOL group item. If we change this to set a byte array (type Byte occurs any) to the group item on the client side and then pass the byte array instead then it works ok.

    If you would like to create a support incident with customer care and put it to my attention, I would be glad to take a look at your scenario to see if it is indeed the same problem?

    Thanks.

Reply
  • I think that we might have discovered a problem in the area of calling a WCF Service when passing certain types of parameters by value in and out of the interface. The error message that we are receiving is similar to the one you are receiving.

    Can you confirm what your service methods are using as parameters? The problem that we found occurs when trying to pass a data only object by value as a parameter in order to pass a COBOL group item. If we change this to set a byte array (type Byte occurs any) to the group item on the client side and then pass the byte array instead then it works ok.

    If you would like to create a support incident with customer care and put it to my attention, I would be glad to take a look at your scenario to see if it is indeed the same problem?

    Thanks.

Children
No Data