I want to communicate with the console XML RPC server from my powerful application. Is it possible?
Steps: 1. Launch the XML RPC Console Server
Code for XML console RPC server:
using System; using System.Collections; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Http; using CookComputing.XmlRpc; public class StateNameServer : MarshalByRefObject, IStateName { public string GetStateName(int stateNumber) { return "whatever"; } } class _ { static void Main(string[] args) { IDictionary props = new Hashtable(); props["name"] = "MyHttpChannel"; props["port"] = 5678; HttpChannel channel = new HttpChannel(props,null,new XmlRpcServerFormatterSinkProvider()); ChannelServices.RegisterChannel(channel,false); RemotingConfiguration.RegisterWellKnownServiceType( typeof(StateNameServer),"statename.rem",WellKnownObjectMode.Singleton); Console.WriteLine("Press <ENTER> to shutdown"); Console.ReadLine(); } }
Launching the Silverlight Application I used the code from http://code.google.com/p/xmlrpc-silverlight/ I created a new Silverlight application to which I linked the code from this link. When I launch the website (in localhost with port 1139) that runs my SL application, a SecurityException occurs.
void ResponseResponse(IAsyncResult result) { XmlRpcHelperRequestState state = result.AsyncState as XmlRpcHelperRequestState; try { state.Response = (HttpWebResponse)state.Request.EndGetResponse(result); ... } catch (Exception e) {
I am using VS2008 Professional, XP Professional, .net 3.5, Silverlight3. I will be happy to provide you with any additional information (or code).
source share