Sunday 15 July 2012

c# - How to bind WCF methods to arbitrary URIs -


I use WCF (through the use of WebChannelFactory) to implement certain services that Outside the WCF perspective of technologies, there is only one method in my interface, let's call it "out-stuff", therefore, the same method can be used by these services, or like, or

in all instances, WebGet / WebWeb for binding method for URI Uaraitimplet is accomplished through the member. Specialty. But this means, all URIs in the "get-stuff" method should follow a specific template. For example, I can create UriTemplate = "/ get-stuff" so that my method is always bound to / get-stuff.

However, I want my method to be any arbitrary URI. BTW, the parameters are passed as a postal data, so I do not have to worry about complying with URI for the parameters of the method.

Why do not you do something like this

  endpointAndres endpoint address = New Endpoint Address ("Any service URL"); ChannelFactory & LT; IMyService & gt; ChannelFactory = New Channel Factor & lt; IMyService & gt; (Binding, endpoint address); IMyServiceclient = channelFactory.CreateChannel (); Client.getStuff ();  

No comments:

Post a Comment