0

I've been told that adding an HTTP RPC web service given an existing SOAP web service implemented with WCF is as simple as adding a webHttpBinding and a couple of attributes.

I'd be grateful if someone could show how to implement such an HTTP RPC web service using webHttpBinding given an existing SOAP web service that is based on WCF. It would be super helpful if the answer could show all the code for both services and even more helpful if the example is self-contained so that someone could install for testing without having to know anything about either. FYI, while I have programmed on the .NET stack it's been ~5 years and today all my work is on LAMP so I'm just not familiar enough with the latest generation .NET stack or it's current runtime environments.

My specific use-case is a set of two (2) services where one responds with an AuthToken and then a second service where I pass the AuthToken and Username, Password and another bit of information and the response back is a user object with attributes like 'first_name', 'last_name', etc. Ideally I'd be able to access those same services via two different URLs and the responses I would get back would be in JSON format.

Note I'm looking for an example to be installed by someone else who programs on the .NET stack but isn't highly motivated to do won't much extra work. I'm trying to get an HTTP-based web service I can use without having to add a SOAP client to the existing PHP framework I am using and I think if I could get a concise example of how to add such an HTTP RPC web service the .NET programmer might be happily willing to add the HTTP RPC web service for my needs. FYI, the web service in question was developed specifically for this use case and is not part of a standard set of SOAP services documented for and in use by lots of other developers.

MikeSchinkel
  • 4,947
  • 4
  • 38
  • 46
  • Did you see this question http://stackoverflow.com/questions/186631/rest-soap-endpoints-for-a-wcf-service ? – Darrel Miller Apr 17 '11 at 00:49
  • @Darrel Miller - No I did not, thank you! I did look but didn't find that question for some reason. Should I delete this question? – MikeSchinkel Apr 17 '11 at 00:55
  • @Mike Not sure. I don't think the other question addresses your auth token issues. – Darrel Miller Apr 17 '11 at 01:15
  • What is an "HTTP RPC Web Service"? I've never heard the term. – John Saunders Apr 17 '11 at 02:32
  • @John It is what most REST services should be called. It uses HTTP as an application protocol, but the client and server couple on URLs, request and response types. – Darrel Miller Apr 17 '11 at 20:12
  • @Darrel: I'm confused - thought REST was "anti-RPC"? Anyway, thanks. I had never seen the term used to refer to REST. – John Saunders Apr 17 '11 at 22:02
  • @John It is. However, the majority of services that claim to be REST are not. The term has been hijacked. It causes a lot of confusion. – Darrel Miller Apr 18 '11 at 00:45
  • @John Saunders - Exactly, as @Darrel Miller says. I chose to ask about an HTTP RPC service because one could take a SOAP service and relatively easily add a Remote Procedure Call interface that uses HTTP as a transport but to create a fully RESTful web services almost always requires the services to be re-architected. I almost explained the distinction in the question but in recent experience I've found explaining such things in advance only inflames the trolls so I didn't. See http://en.wikipedia.org/wiki/Web_service#Styles_of_use and http://bit.ly/elVdMH – MikeSchinkel Apr 18 '11 at 09:45

0 Answers0