from a Wcf data service client (inherited from System.Data.Services.Client.DataServiceContext) I would like to invoke a service operation defined on a Wcf Data Service that returns void
[WebGet]
public void Operation()
{
// logic
}
The only reasonable method I found is the Execute, but how could I use it with a void operation?
Thank you
I have found a workaround for this problem.
This website solved me quite a few problems before, so I thought it would be nice to share back.
The quick answer to your question is:
The “empty” string should be null or empty upon response. It “works around” the HttpWebRequest method mentioned on the post above.
Further more, it is also possible to get primitive types back using this technique.
Lets say I have this Method:
When you try the normal execution it fails (Vitek Karas explains it well in his reponse above):
But the following will do the trick:
Please note the Replace(“Authenticate()”, “Authenticate”), which omits () from the query string (otherwise it will cause error).
Hope it helps.
– Itye