0

I am new in ASP.NET and i need to implement simple xmlrpc request in asp.net. Client side(in ASP.Net) should send two parameters like:

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>sample.add</methodName>
<params>
<param><value><i4>5</i4></value></param>
<param><value><i4>7</i4></value></param>
</params>
</methodCall>

Can anyone guide me to quick start? Little detail explanation would be appreciated.

Thank You in advance!

2
  • So you want a .NET server-to-server method call? Does the server in your example have an HTTP endpoint already defined (or is that what you're asking)? Commented Apr 1, 2012 at 6:34
  • Yeah, I want Server(.Net) to Server(C++ implementation) method call. Commented Apr 1, 2012 at 11:42

1 Answer 1

3

You can use xml-rpc.net to easily make clients:

XML-RPC Clients

(modified to be more specific)

It is easy to create client code which makes calls to XML-RPC servers. All you need to do is define an interface representing the XML-RPC end-point and then use the XmlRpcProxyGen class to automatically generate the code for the proxy.

[XmlRpcUrl("http://your url")]
public interface ISample : IXmlRpcProxy
{
    [XmlRpcMethod("sample.add")]
    int Add(int a, int b); 
}

The proxy instance is generated using static method Create of the XmlRpcProxyGen class:

ISample proxy = XmlRpcProxyGen.Create<ISample>();

The method on the proxy can then be called to make the XML-RPC request to the server:

int v = proxy.Add(5, 7);
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I was looking fr a simple explanation and yours was the best I found so far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.