Reputation: 27323
I have become quite frustrated of WCF as I just want to use this simple scenario:
/method/{param1}/{param2}/
and a 3th parameter that is sent to the service as XML as POST data.I can create 1. and 2. but no way I can use 3. I tried adding both webHttpBinding
and basicHttpBinding
endpoints in my services config; I fooled around with the <services/>
tag, but I just can't get this working. What am I missing here?!
N.B. I checked out this article: REST / SOAP endpoints for a WCF service but nothing what is described there seems to work here?!
Upvotes: 1
Views: 2049
Reputation: 141994
You cannot generate a client proxy for a webHttpBinding and basicHttpBinding uses SOAP. There is no way around this. The question you are referring to enables both bindings. You cannot cherry-pick the features you like from each binding.
However, why would you want to create a client proxy? Using the Microsoft.Http library, calling your service is as simple as,
var client = new HttpClient();
var content = HttpContent.Create(myXmlDocument);
client.Post("http://example.org/param1/param2",content)
Upvotes: 1