Results 1 to 9 of 9

Thread: WCF doubts

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Location
    fgh
    Posts
    332

    WCF doubts

    Hello,

    in my WCF application, i have created two svc files, classes are Employee and Project.

    Now i am facing a problem of client application need to call two service references to get two classes.

    I have hosted a web application in IIS and created two seperate svc files for calling project and employee.

    <%@ ServiceHost Language="C#" Debug="true" Service="ManageWorks.WCF.Employee" %>
    <%@ ServiceHost Language="C#" Debug="true" Service="ManageWorks.WCF.Project" %>

    In my client i need to add only one service reference and all the classes need to be accessible using that.

    I hope my question is clear, even having two svc files, how could we call two different class in one single client service reference.

    thankzzzzzzz
    Attached Images Attached Images  
    Last edited by sureshvijayan; Jul 21st, 2009 at 09:07 AM.
    gh

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: WCF doubts

    You could simply create a interface that implements both services:
    Code:
    public interface dummyServices : AccountService, MoneyService
    { 
    }
    Where dummyService can do all the calls from the AccountService and the MoneyService
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: WCF doubts

    Yeah the only options you have as far as I can see are what Lightning suggested or the obvious... combine them both in the same service I guess it depends how much separation you need between the two things that the services deal with (in this case: Customers and Employees) - I wouldn't personally go just creating a separate service for every single category of item in your program (unless you have an awful lot of methods in each one) for this precise reason... but then I have only created small programs using WCF so far, so I guess im not the best person to offer advice on the design.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: WCF doubts

    I don't see how that's a problem. I think you might have misunderstood the concept of services here... when you create two services, you create them separately because they serve different purposes. They are therefore two different services, they just happen to sit in the same 'project' or virtual directory in IIS. You'll need both references in place. If you want one reference, you need one service. It's sort of like saying "Well, I have a User class and an Orders class... why can't I just use one class for both?" (Because it doesn't make sense)

    Alternatively, you could always move the interface classes out into another class library and references those and then call the services via an IClientChannel but that sort of defeats the purpose of WCF IMEO.

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: WCF doubts

    whats an IMEO?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: WCF doubts

    In My Esteemed Opinion.


  7. #7
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: WCF doubts

    Hmmmm, you win this round...





    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: WCF doubts

    Of beer? I graciously accept.

  9. #9
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: WCF doubts

    golf fool
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width