0
votes

I have been assigned a task to create a WCF service which able to insert or fetch record. I was provided with one DLL, with the help of that I have to create. I am unable to see any method name not it's content. I downloaded one application which decompiled the assembly. Now I am able to see content of it. There are 2 class, one class contain properties (which accesses through get and set method) another class contain method which add record and fetch record.

How to create WCF service from that? I have already created lot of WCF service before that. In that case I have created cs file that in that created class who have properties(get,set) given name to class as datacontract and member as datamember. In service one class which implement interface. In interface just declare method and in interface define that method where I do inert/serach code and consumer application creating instance of service class and calling that method. But how to do in this situation?

1

1 Answers

1
votes

You should be able to create a WCF service that wraps the provided DLL.

  1. Create the ServiceContract (interface) with the methods you want.
  2. Create the service that implements the contract, and add a reference to the provided DLL. In the service implementation, you can then call the methods from the provided DLL that you need.

You can also create DataContracts as needed for returning the data (or passing data in).

Essentially, it's exactly the same as the previous WCF services you've created, except that the actual functionality is in a separate assembly (DLL) that you reference, rather than being in the service implementation itself.