views:

79

answers:

3

How do I build a XML-RPC web service in C#?

A: 

You could implement either a generic handler (.ashx) or an ASP.NET 2.0-compatible service (.asmx). You would then need to handle the XML parsing and construction either using .NET classes for XML or just on your own.

Edit: I took out information about WCF since the question changed, making it irrelevant.

Andrew
-1: Andrew, I don't believe that WCF supports XML-RPC.
John Saunders
@John-Saunders When I wrote my answer, the question was different. It mentioned not wanting to use SOAP, which was the basis of my comment about WCF (basically saying, "Why not?").
Andrew
@Andrew: Ok, I'll reverse my downvote if you'll edit the answer to be an answer to the current question. In other words, leave WCF out of the answer.
John Saunders
@John-Saunders Done.
Andrew
+2  A: 

I've seen some people produce "web services" that are just simple .aspx pages that spits out Xml instead of html.

The "proper" way to do this is to probably to implement your own custom http handler though.

That said, you should have a really good reason to not use SOAP based services before you go to all that effort.

UPDATE: Have you seen http://www.xml-rpc.net/:

XML-RPC.NET is a library for implementing XML-RPC Services and clients in the .NET environment.

Kragen
A: 

if you mean RPC where you cliend simply sends raw XML via form variables, etc, and you parse it in the implementation of your service, .net 3.5 and wcf support out of the box POX services.

http://msdn.microsoft.com/en-us/library/aa395208.aspx

DevilDog74
@Devil: "XML-RPC" is the name of a specific protocol.
John Saunders
Yes it is, and a very old one at that. I just learned today that in .net 3.0 microsoft added the XmlSerializerFormat attribute, OperationFormatStyle enum, and OperationFormatUse enum, that allow you to instruct WCF to generate your WSDL using RPC/Literal or RPC/Encoded. more info here... http://msdn.microsoft.com/en-us/library/system.servicemodel.xmlserializerformatattribute(v=VS.85).aspx
DevilDog74
@Devil: "RPC" in "RPC/Literal" still has nothing to do with XML-RPC. Were you aware that the term "RPC" stands for "Remote Procedure Call"? It's a very general term. XML-RPC is the protocol that preceded SOAP. In other words, SOAP is XML-RPC plus fixes.
John Saunders