You must Sign In to post a response.
  • Category: WCF

    WCF service how to create

    I have been assigned a task to craete 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 decompile assembly.Now I able to see content of it.There are 2 class,one class contain properties(which acsess 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?
  • #764267
    Hai Pinky,
    If they have provided the dll which is having the definitions for the adding and deleting the records as well as other methods, then you just need to create a new WCF service and use this dll to use its method for CRUD operations.
    Below steps can be followed:
    1. Create a new WCF service
    2. Add reference of the given dll
    3. Create the same method names and use the reference assembly methods by passing the parameters for the methods.
    4. Host the WCF in IIS
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #764295
    Hi,

    If you want to create service using existing dll, then first consume that dll into your application, get the full source of that and include that into your project solution and consume that dll by adding reference and add new methods in that same project and build the solution it will create new dll with different version use that for your future reference.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #764313
    Hi,

    Add reference of that provided dll to your WCF service.
    In your interface, create object of the class of provided dll in which readymade insert/fetch methods are present.
    From your insert/search methods just call the available insert/fetch methods from that dll using created object.
    Here you can pass the required parameters and get everything done through provided dll.

    Hope it helps you.
    Regards,
    Shashikant Gurav
    shashikantgurav22@gmail.com

  • #766724
    [Response removed by Admin. Read forum policies.]

  • #766731
    Hi

    Create one Class for Service purpuse

    IStudentEnrollmentService.cs

    you can write the code here for get and Save method


    [ServiceContract]
    public interface IStudentEnrollmentService
    {
    [OperationContract]
    void EnrollStudent(Student s);
    [OperationContract]
    Student[] GetEnrolledStudents();
    }


    then you can add this line for property layer


    [DataContract]
    public class Student
    {
    private string name;

    [DataMember]
    public string StudentName
    {
    set { this.name = value; }
    get { return this.name; }
    }
    }



    you can go through below link

    "codeproject.com/Articles/576820/Basic-Step-by-Step-WCF-WebService"


    follow this steps above url explain clearly.

    1. Create a new WCF service
    2. Add reference of the given dll

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #766758
    [Response removed by Admin. Read forum policies.]


Sign In to post your comments