I am just trying to get to grips with using WCF, and I am wandering if someone could tell me if I have the right idea with endpoints.
I have been working through the videos on msdn, and now I am wandering about the way to configure WCF Service. The scenario is if I have multiple IServices, e.g. such that I have an IThis and IThat, and the client needs the access both (note: they will be using net.tcp),
-
IThis handles database querying and,
-
IThat handles calculations independent of the database,
I assume that I have to define separate Endpoints for IThis and IThat, that are referenced in the client separately. Or would I create an overall IThisAndThat Service that gets referenced in the client and contains the functionality for both??
Or is are the other ways for developing and handling WCF Services with multiple IServices? While I’m asking can you define base address for tcp or only http?
~Thanks all, any help or pointers would be great.
You can do both:
IThis, another one forIThatIThisandIThatThat choice is entirely up to you.
For every service implementation class that you have, you can define any number of endpoints you wish to have. So if you have an
ThisServiceimplementingIThis, you can define a HTTP and a TCP endpoint for that, and you also have aThatServicethat implementsIThatfor which you define a TCP endpoint. That’s totally up to you.BUT: you can only define your endpoints for each service implementation class – if you have a
ThisAndThatServiceimplementing both service contracts, you cannot define 3 endpoints forIThisand two different ones forIThat– the endpoints you define are per service implementation class.Yes, absolutely – you can define a base address for each of the various addressing schemes (http, net.tcp, net.msmq, net.pipe and so forth).