none
Add a global switch to a web service RRS feed

  • Question

  • I have a web service with a number of methods each returning some kind of data. Is possible to add a global switch to the service that would drive data from every method into another piece of code instead of being returned?

    Thanks

    Saturday, January 28, 2017 1:08 PM

All replies

  • Your question is really unclear. Global switch? Drive data from every method? Please provide a more concrete example of what you're trying to do. Also note that if you own the source code then your service can do anything you want and call any other methods you want. But the "instead of being returned" part also is unclear as ultimately a service call needs to return.
    Monday, January 30, 2017 3:13 PM
    Moderator
  • I guess what I am asking for is an interceptor. How can I add one to the whole web service? The functionality is: based on a parameter Interceptor will decide how to return data from a calling method.

    Thanks

    Monday, January 30, 2017 5:27 PM
  • If you need to analyze a message request on the server side then you'll need to implement and hook up a message inspector.

    Monday, January 30, 2017 5:41 PM
    Moderator
  • Hi markgoldin,

    >>Is possible to add a global switch to the service that would drive data from every method into another piece of code instead of being returned?

    What do you mean by this? Do you mean that, you call a WCF Service method from Client, and WCF Service method will call other methods in WCF Service instead of returning message, or you want to call WCF Client method? I think a business logic would be much helpful to understand your issue.

    If you mean calling server side method, I think you could call methods in your service method before returning.

    If you mean calling client side method, do you have any problem passing return value to the method?

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 31, 2017 7:41 AM
  • Hi markgoldin,

    Have your issue been resolved? If not, please feel free to let us know. We are glad to help you.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 3, 2017 1:37 AM