Harry

Harry

  • NA
  • 13
  • 0

How to call an other WCF service within a WCF Services

Feb 10 2011 10:24 AM
Hell!

Actually I am relative new to WCF programming and I make my steps forward, but at the moment I wonder if it is possible to have a call to a WCF service (e.g. search for a Person) and after the service did succeed I want to call another service (e.g. get his addresses).

So the plan is like this


Inside Service GetPersonalData(...)
 call Service GetAddresses(...)
  call Service GetDiagnoses(...)

The services GetAddresses(...) and GetDiagnoses(...) should be called from inside the service GetPersonalData(...).

And: the services GetAddresses and GetDiagnoses must be able to be called with different endpoints (address, binding ...these data are going to come from the database, not from a .config file).

Maybe this is not a good design, but what I want to achieve is to stay on the server side and not to have many roundtrips client <-> server like this:

Client ----> (serivce GetPersonalData) server
<----- back to client
Client ----> (service GetAddresses) on server
<----- back to client
Client ----> (service GetDiagnoses) on server
<----- back to client


Should be like this

Client ---->
service1
------ service2
------ service3

<----- back to client.

Has anyone an idea of how to do this?

Of course, service1 could do the things of service2 and service3, but this is not what we want to have.
Thank you!


Answers (3)