0

I have my service up and running and lately I was trying to add router in the middle. My problem is as long as I have my service proxy in the client side everything is working, but, I don't want to add service proxies to the client side. Is there any way to add only a proxy of router and have all the methods from service in the client side?

Daniel
  • 3,322
  • 5
  • 30
  • 40

1 Answers1

2

You have to use the WCF Routing Service to achieve that. The Routing Service helps you to decouple the service from the clients and you no longer need service proxies in clients but of course the proxy of routing service.

To know more about routing service check this.

http://www.prideparrot.com/blog/archive/2011/8/routing_service_and_content_based_routing

http://msdn.microsoft.com/en-us/library/ee517421.aspx

Sixto Saez
  • 12,610
  • 5
  • 43
  • 51
VJAI
  • 32,167
  • 23
  • 102
  • 164
  • I've tried these, but my problem is in the client side IPizzaService (for the first link) cannot be found. – Daniel Jun 20 '12 at 09:37
  • Yes of-course don't need that in the client the IPizzaService is only used by the router and that what the article says. The routing service itself has configuration and in client section of that configuration we have the endpoints of the real services. The client will point to only the routing service. – VJAI Jun 20 '12 at 09:41
  • I don't get it... when I type it I get compilation error.. how do I do't need it? – Daniel Jun 20 '12 at 09:42
  • Please little more clear with your question. Are you trying to access the service from the client? – VJAI Jun 20 '12 at 09:45
  • I have a method say sayhi in the service side, before router I just add a proxy of host endpoint and I had sayhi in client.. now I'm using router and in order to have the sayhi method i need to add proxy of service too, – Daniel Jun 20 '12 at 09:52
  • but what I want is just add a proxy of router and have the sayhi method again – Daniel Jun 20 '12 at 09:52
  • hm.. i understand now. what i've done in the sample is I've put all the service/data contracts in a separate assembly and referenced that assembly in the client as well.. so i can still access the service methods but with the router's address. if you download the attached sample you'll get a very clear idea. – VJAI Jun 20 '12 at 10:23