I think the better option is use WCF as recommended (today) way to create web services. Creating service with WCF infrastructure allows you to host your service in IIS, WAS (win service), console app without much problems and friction. This project (providing XmlRpcEndpointBehavior) and tutorial can help (already discussed here).
You can even easily parse request body xml and provide required response xml structure - by using WCF support classes/objects:
for ex:
[OperationContract]
[WebInvoke(
BodyStyle = WebMessageBodyStyle.Bare,
Method = "POST",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
UriTemplate = "/somemethod?param1={param1}¶m2={param2}")]
System.ServiceModel.Channels.Message SomeMethod(Stream stream, string param1, string param2)
{
string xmlString;
var inputStream = stream;
using (var streamReader = new StreamReader(inputStream))
{
xmlString = streamReader.ReadToEnd();
}
var sourceXml = new XmlDocument();
sourceXml.LoadXml(xmlString);
//...
var xml = new XDocument(...);
//...
var settings = new XmlWriterSettings();
settings.Indent = true;
var sb = new StringBuilder();
using (var writer = XmlWriter.Create(sb, settings))
{
xml.WriteTo(writer);
writer.Flush();
}
WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";
return WebOperationContext.Current.CreateTextResponse(sb.ToString());
}
By the way asmx, svc - it is only for hosting your service in web app (IIS), asmx - obsolete, ashx - http handler (not WS-standard web service, strictly speaking), not from WCF's world - if you go ashx way you will, probably, need XML-RPC.NET is a library.