Version 2.3.0 has been released:
http://xmlrpcnet.googlecode.com/files/xml-rpc.net.2.3.0.zip
New features and changes:
* Issue 15: Support for accessing response headers and cookies.
* Issue 17: Support for not sending a params element if no method
parameters.
* Changes:
o Issue 16: Content type set before writing to response stream
(fixes Mono issue).
o Issue 18: Modified proxy code generation so that it verifies -
prevents "Operation could destabilize the runtime" problem.
o Issue 19: XmlRpcListenerService now sets Content Length header
and does not use chunked content by default.
It is excellent! Thanks is large!
--- In XMLRPCNET@yahoogroups.com, "charlescookuk" <chascook@...> wrote:
>
> Version 2.3.0 has been released:
>
> http://xmlrpcnet.googlecode.com/files/xml-rpc.net.2.3.0.zip
>
> New features and changes:
>
> * Issue 15: Support for accessing response headers and cookies.
> * Issue 17: Support for not sending a params element if no method
> parameters.
> * Changes:
> o Issue 16: Content type set before writing to response stream
> (fixes Mono issue).
> o Issue 18: Modified proxy code generation so that it verifies -
> prevents "Operation could destabilize the runtime" problem.
> o Issue 19: XmlRpcListenerService now sets Content Length header
> and does not use chunked content by default.
>
Hi
Can someone help in solving out following problem :
I am implementing fotolia Business api in my webapplication using c#.
My problem is that I getting XMLRPCResponse in struct format which I
can see through Fiddler but unable to bind with local struct variable.
My Code is as under :
using CookComputing.XmlRpc;
public partial class GetSearchResult : System.Web.UI.Page
{
public struct searchrequest
{
public int language_id;
public string words;
}
public struct result
{
Here code for binding returned response is be written.
}
[XmlRpcUrl("http://us.fotolia.com/Xmlrpc/rpc")]
public interface IFotolia : IXmlRpcProxy
{
[XmlRpcMethod("xmlrpc.getSearchResults")]
result GetSearchResults(string strApiKey, searchrequest search);
}
protected void GetSearchResult_Click(object sender, EventArgs e)
{
IFotolia fotoliaApi = XmlRpcProxyGen.Create<IFotolia>();
result resultdata = new result();
try
{
searchrequest search1 = new searchrequest();
search1.language_id = 2;
search1.words = "model";
resultdata = fotoliaApi.GetSearchResults("MyAPIKEY",
search1);
lblError.Text = "Successful";
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
Here The code is running fine but in variable resultdata I am not
getting any response whereas in fiddler it is showing me HTTP Response.
Please help me.
thanks & regards
sanjeev
sanjdhi2004@...
Hi Sanjeev: this is one of those XML-RPC APIs where instead of
returning an array of results, a struct is used with a uniquely named
member for each item in the set of results. At least this is my
understanding from this page at Fotolia:
http://www.fotolia.com/Services/API/Method/getSearchResults
The only way to handle this is to define the return type as
XmlRpcStruct and write some helper code to extract the items from the
struct.
:Charles
--- In XMLRPCNET@yahoogroups.com, "sanjdhi2004" <sanjdhi2004@...> wrote:
>
> Hi
>
> Can someone help in solving out following problem :
>
> I am implementing fotolia Business api in my webapplication using c#.
> My problem is that I getting XMLRPCResponse in struct format which I
> can see through Fiddler but unable to bind with local struct variable.
>
> My Code is as under :
>
> using CookComputing.XmlRpc;
>
> public partial class GetSearchResult : System.Web.UI.Page
> {
> public struct searchrequest
> {
> public int language_id;
> public string words;
> }
>
> public struct result
> {
> Here code for binding returned response is be written.
> }
>
> [XmlRpcUrl("http://us.fotolia.com/Xmlrpc/rpc")]
> public interface IFotolia : IXmlRpcProxy
> {
> [XmlRpcMethod("xmlrpc.getSearchResults")]
> result GetSearchResults(string strApiKey, searchrequest search);
> }
>
> protected void GetSearchResult_Click(object sender, EventArgs e)
> {
> IFotolia fotoliaApi = XmlRpcProxyGen.Create<IFotolia>();
> result resultdata = new result();
> try
> {
> searchrequest search1 = new searchrequest();
> search1.language_id = 2;
> search1.words = "model";
> resultdata = fotoliaApi.GetSearchResults("MyAPIKEY",
> search1);
> lblError.Text = "Successful";
> }
> catch (Exception ex)
> {
> lblError.Text = ex.Message;
> }
> }
>
>
> Here The code is running fine but in variable resultdata I am not
> getting any response whereas in fiddler it is showing me HTTP Response.
>
>
> Please help me.
>
> thanks & regards
>
> sanjeev
> sanjdhi2004@...
>
I've build a Web Application based on v2.2.0 of XML-RPC and the sample
MathService code. If I configure the application properties to use the
IIS Web Server, I get an HTTP 500 server error when I attempt to access
Math.rem.
If I change the application properties to use the VS Development Server
the problem goes away.
My production application uses XMLRPC and needs to be configured to use
the IIS Web Server, so it has the same problem as the sample
application.
Does anyone know why this is? Am I missing something fundamental?
Derrick
I recently attempted to upgrade an application from v2.2.0 to v2.3.0
and ran into a problem: After the upgrade, all *.rem requests generate
an HTTP 500 server error. I tried building a sample application based
on the MathService code and couldn't get it to work with v2.3.0.
However, recompiling the sample Math application with v2.2.0 fixed the
problem.
The environment is Windows Vista SP1 with the applications compiled and
run from VS2008. I've tried it on both the 32-bit and 64-bit versions
of Vista with the same results.
Any ideas?
Sorry, my fault. A change for using HttpListener conflicted with the
case when hosted by ASP.NET. I'll fix this asap.
:Charles
--- In XMLRPCNET@yahoogroups.com, "derrick_brundage"
<derrick.brundage@...> wrote:
>
> I recently attempted to upgrade an application from v2.2.0 to v2.3.0
> and ran into a problem: After the upgrade, all *.rem requests generate
> an HTTP 500 server error. I tried building a sample application based
> on the MathService code and couldn't get it to work with v2.3.0.
> However, recompiling the sample Math application with v2.2.0 fixed the
> problem.
>
> The environment is Windows Vista SP1 with the applications compiled and
> run from VS2008. I've tried it on both the 32-bit and 64-bit versions
> of Vista with the same results.
>
> Any ideas?
>
Implementing a client and server.
The server started throwing exceptions when I upgraded.
Traced the problem to this code XmlRpcHttpServerprotocol.cs
lines 71-74
if (!httpResp.SendChunked)
{
httpResp.ContentLength = responseStream.Length;
}
httpResp.SendChunked leads to
XmlRpcHttpResponse.cs
lines 47-51
bool IHttpResponse.SendChunked
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
httpResp.ContentLength leads to
XmlRpcHttpResponse.cs
lines 65-69
Int64 IHttpResponse.ContentLength
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
Thanks
Ron
I've written a Windows Service with .Net that makes a lot of operation
on a local database. I've successfully exposed some functions using
XmlRpcNet to remote clients. Now I've to make possible to process
concurrent request from client without opening and closing anytime
connection to Db. If I use Singcall registration of my object class
I've to open and close connections anytime and if I expose my object
in Singleton mode I've to serialize concurrent request. Searching all
over then .net i found that .Net remoting make possible to use
"Client activated" mode that's what i need : a single and private
istance for each client but in a simple concurrent scenario. So I'm
asking anyone if it's possible to expose Xmlrpc Net in "Client
Activated" mode and if there someone that can poste code to do this.
I've searched a lot into the net but I haven found anything...
Please help me...
Thank a lot..
Piazza Matteo
Fixed version now available:
http://xmlrpcnet.googlecode.com/files/xml-rpc.net.2.3.1.zip
I've written a test program which hosts ASP.NET to prevent something
like this happening again.
--- In XMLRPCNET@yahoogroups.com, "charlescookuk" <chascook@...> wrote:
>
> Sorry, my fault. A change for using HttpListener conflicted with the
> case when hosted by ASP.NET. I'll fix this asap.
>
> :Charles
>
> --- In XMLRPCNET@yahoogroups.com, "derrick_brundage"
> <derrick.brundage@> wrote:
> >
> > I recently attempted to upgrade an application from v2.2.0 to v2.3.0
> > and ran into a problem: After the upgrade, all *.rem requests
generate
> > an HTTP 500 server error. I tried building a sample application
based
> > on the MathService code and couldn't get it to work with v2.3.0.
> > However, recompiling the sample Math application with v2.2.0 fixed
the
> > problem.
> >
> > The environment is Windows Vista SP1 with the applications
compiled and
> > run from VS2008. I've tried it on both the 32-bit and 64-bit
versions
> > of Vista with the same results.
> >
> > Any ideas?
> >
>
Hi - I've got a .NET Class instance which I want to pass as an
argument to my XML-RPC.NET server. It's quite a big complex class. My
reading of the doco is that only structs are suitable as
arguments/return values - not class instances.
I realise I could I could build a struct to mimic the class but does
anyone have any smart ideas of how I could do the conversion more easily ?
I'm thinking about introspection perhaps ? (Something I haven't used
in .NET) but I'm open to any smart ideas.
thanks
Richard.
Hi Piazza: client activation doesn't make sense where the server is
exposing an XML-RPC endpoint. All the client knows is that there is a
HTTP-based XML-RPC service on the specified port. It can't create a
proxy to an individual .NET object on the server which is what happens
in client activation.
You could register your server class as SingleCall and use a pool of
database connections to get round the problem of opening and closing a
connection for each call.
:Charles
--- In XMLRPCNET@yahoogroups.com, "kyosho1975" <kyosho1975@...> wrote:
>
> I've written a Windows Service with .Net that makes a lot of operation
> on a local database. I've successfully exposed some functions using
> XmlRpcNet to remote clients. Now I've to make possible to process
> concurrent request from client without opening and closing anytime
> connection to Db. If I use Singcall registration of my object class
> I've to open and close connections anytime and if I expose my object
> in Singleton mode I've to serialize concurrent request. Searching all
> over then .net i found that .Net remoting make possible to use
> "Client activated" mode that's what i need : a single and private
> istance for each client but in a simple concurrent scenario. So I'm
> asking anyone if it's possible to expose Xmlrpc Net in "Client
> Activated" mode and if there someone that can poste code to do this.
> I've searched a lot into the net but I haven found anything...
>
> Please help me...
>
> Thank a lot..
>
> Piazza Matteo
>
Hi Richard: its undocumented but you can use a class as long as its
public members are types which can be serialized to XML-RPC types.
:Charles
--- In XMLRPCNET@yahoogroups.com, "richardshea98" <yahoogroups@...> wrote:
>
> Hi - I've got a .NET Class instance which I want to pass as an
> argument to my XML-RPC.NET server. It's quite a big complex class. My
> reading of the doco is that only structs are suitable as
> arguments/return values - not class instances.
>
> I realise I could I could build a struct to mimic the class but does
> anyone have any smart ideas of how I could do the conversion more
easily ?
>
> I'm thinking about introspection perhaps ? (Something I haven't used
> in .NET) but I'm open to any smart ideas.
>
> thanks
>
> Richard.
>
Hi everybody,
I´m trying to setup a new XMLRPC server according the example in the
faq: http://www.xml-rpc.net/faq/xmlrpcnetfaq.html#3.2
- What project type (template) do I have to use?
- Is it really necessary to compile it manually and to move it
manually to the BIN directory?
- Do I really have to point to the service via Web.config or is there
also another way? ASAIK soap services can be started directly by
referring to the ASMX
Sorry for that (maybe silly) questions. I had no problem to setuo a
client with XML-RPC.net but I'm struggling now with the server.
Thanks and regards,
Lorenz
--- In XMLRPCNET@yahoogroups.com, "random.defense"
<random.defense@...> wrote:
>
> Hi everybody,
>
> I´m trying to setup a new XMLRPC server according the example in the
> faq: http://www.xml-rpc.net/faq/xmlrpcnetfaq.html#3.2
>
> - What project type (template) do I have to use?
> - Is it really necessary to compile it manually and to move it
> manually to the BIN directory?
> - Do I really have to point to the service via Web.config or is
there
> also another way? ASAIK soap services can be started directly by
> referring to the ASMX
>
> Sorry for that (maybe silly) questions. I had no problem to setuo a
> client with XML-RPC.net but I'm struggling now with the server.
>
> Thanks and regards,
> Lorenz
>
Hi Lorenz,
Select web service template.
Add reference to CookComputing.XmlRpcV2.dll
service1.asmx example:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports CookComputing.XmlRpc
Public Structure SumAndDiffValue
Public sum As Integer
Public difference As Integer
End Structure
<System.Web.Services.WebService(Namespace:="http://zveky.com/")> _
<System.Web.Services.WebServiceBinding
(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class SumAndDiffService
Inherits XmlRpcService
<XmlRpcMethod("samples.sumAndDifference")> _
Public Function SumAndDifference(ByVal x As Integer, _
ByVal y As Integer) _
As SumAndDiffValue
Dim ret As SumAndDiffValue
ret.difference = x - y
ret.sum = x + y
Return ret
End Function
End Class
web.config example:
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="Service1.asmx"
type="xmlrpc3.SumAndDifference,xmlrpc3"/>
</httpHandlers>
<compilation debug="true"/></system.web>
</configuration>
Hi,
what I did so far:
1. Add new website with template "ASP.NET Web Service". This generated:
- Service.asmx
- ~\App_Data\Service.cs
2. I made a reference to CookComputing.XmlRpcV2.dll
3. I replaced the content of Service.cs by the following code found in
the faq:
using System;
using CookComputing.XmlRpc;
struct SumAndDiffValue
{
public int sum;
public int difference;
}
class SumAndDiffService : XmlRpcService
{
[XmlRpcMethod("sample.sumAndDifference")]
public SumAndDiffValue SumAndDifference(int x, int y)
{
SumAndDiffValue ret;
ret.sum = x + y;
ret.difference = x – y;
return ret;
}
}
4. If I build this I get the error that the type Service couldn't be
created
Any idea what I'm doing wrong?
Help very appreciated.
Thanks,
Lorenz
--- In XMLRPCNET@yahoogroups.com, "darkob72" <darkob72@...> wrote:
>
> --- In XMLRPCNET@yahoogroups.com, "random.defense"
> <random.defense@> wrote:
> >
> > Hi everybody,
> >
> > I´m trying to setup a new XMLRPC server according the example in the
> > faq: http://www.xml-rpc.net/faq/xmlrpcnetfaq.html#3.2
> >
> > - What project type (template) do I have to use?
> > - Is it really necessary to compile it manually and to move it
> > manually to the BIN directory?
> > - Do I really have to point to the service via Web.config or is
> there
> > also another way? ASAIK soap services can be started directly by
> > referring to the ASMX
> >
> > Sorry for that (maybe silly) questions. I had no problem to setuo a
> > client with XML-RPC.net but I'm struggling now with the server.
> >
> > Thanks and regards,
> > Lorenz
> >
>
> Hi Lorenz,
>
> Select web service template.
> Add reference to CookComputing.XmlRpcV2.dll
>
> service1.asmx example:
>
> Imports System.Web
> Imports System.Web.Services
> Imports System.Web.Services.Protocols
> Imports System.ComponentModel
> Imports CookComputing.XmlRpc
>
>
> Public Structure SumAndDiffValue
> Public sum As Integer
> Public difference As Integer
> End Structure
>
>
> <System.Web.Services.WebService(Namespace:="http://zveky.com/")> _
> <System.Web.Services.WebServiceBinding
> (ConformsTo:=WsiProfiles.BasicProfile1_1)> _
> <ToolboxItem(False)> _
> Public Class SumAndDiffService
> Inherits XmlRpcService
>
> <XmlRpcMethod("samples.sumAndDifference")> _
> Public Function SumAndDifference(ByVal x As Integer, _
> ByVal y As Integer) _
> As SumAndDiffValue
> Dim ret As SumAndDiffValue
> ret.difference = x - y
> ret.sum = x + y
> Return ret
> End Function
> End Class
>
>
> web.config example:
>
> <?xml version="1.0"?>
> <configuration>
> <system.web>
> <httpHandlers>
> <add verb="*" path="Service1.asmx"
> type="xmlrpc3.SumAndDifference,xmlrpc3"/>
> </httpHandlers>
> <compilation debug="true"/></system.web>
> </configuration>
>
Problem could be solved in the meantime.
Thanks everybody.
Regards,
Lorenz
--- In XMLRPCNET@yahoogroups.com, "random.defense"
<random.defense@...> wrote:
>
> Hi,
>
> what I did so far:
>
> 1. Add new website with template "ASP.NET Web Service". This generated:
> - Service.asmx
> - ~\App_Data\Service.cs
>
> 2. I made a reference to CookComputing.XmlRpcV2.dll
>
> 3. I replaced the content of Service.cs by the following code found in
> the faq:
>
> using System;
> using CookComputing.XmlRpc;
>
> struct SumAndDiffValue
> {
> public int sum;
> public int difference;
> }
>
> class SumAndDiffService : XmlRpcService
> {
> [XmlRpcMethod("sample.sumAndDifference")]
> public SumAndDiffValue SumAndDifference(int x, int y)
> {
> SumAndDiffValue ret;
> ret.sum = x + y;
> ret.difference = x – y;
> return ret;
> }
> }
>
> 4. If I build this I get the error that the type Service couldn't be
> created
>
> Any idea what I'm doing wrong?
>
> Help very appreciated.
>
> Thanks,
> Lorenz
>
>
> --- In XMLRPCNET@yahoogroups.com, "darkob72" <darkob72@> wrote:
> >
> > --- In XMLRPCNET@yahoogroups.com, "random.defense"
> > <random.defense@> wrote:
> > >
> > > Hi everybody,
> > >
> > > I´m trying to setup a new XMLRPC server according the example in the
> > > faq: http://www.xml-rpc.net/faq/xmlrpcnetfaq.html#3.2
> > >
> > > - What project type (template) do I have to use?
> > > - Is it really necessary to compile it manually and to move it
> > > manually to the BIN directory?
> > > - Do I really have to point to the service via Web.config or is
> > there
> > > also another way? ASAIK soap services can be started directly by
> > > referring to the ASMX
> > >
> > > Sorry for that (maybe silly) questions. I had no problem to setuo a
> > > client with XML-RPC.net but I'm struggling now with the server.
> > >
> > > Thanks and regards,
> > > Lorenz
> > >
> >
> > Hi Lorenz,
> >
> > Select web service template.
> > Add reference to CookComputing.XmlRpcV2.dll
> >
> > service1.asmx example:
> >
> > Imports System.Web
> > Imports System.Web.Services
> > Imports System.Web.Services.Protocols
> > Imports System.ComponentModel
> > Imports CookComputing.XmlRpc
> >
> >
> > Public Structure SumAndDiffValue
> > Public sum As Integer
> > Public difference As Integer
> > End Structure
> >
> >
> > <System.Web.Services.WebService(Namespace:="http://zveky.com/")> _
> > <System.Web.Services.WebServiceBinding
> > (ConformsTo:=WsiProfiles.BasicProfile1_1)> _
> > <ToolboxItem(False)> _
> > Public Class SumAndDiffService
> > Inherits XmlRpcService
> >
> > <XmlRpcMethod("samples.sumAndDifference")> _
> > Public Function SumAndDifference(ByVal x As Integer, _
> > ByVal y As Integer) _
> > As SumAndDiffValue
> > Dim ret As SumAndDiffValue
> > ret.difference = x - y
> > ret.sum = x + y
> > Return ret
> > End Function
> > End Class
> >
> >
> > web.config example:
> >
> > <?xml version="1.0"?>
> > <configuration>
> > <system.web>
> > <httpHandlers>
> > <add verb="*" path="Service1.asmx"
> > type="xmlrpc3.SumAndDifference,xmlrpc3"/>
> > </httpHandlers>
> > <compilation debug="true"/></system.web>
> > </configuration>
> >
>
Hello,
I'm currently playing a little bit with the XML-RPC.NET library to
call some remote procedures.
Every time I call a remote procedure with a parameter containing a
string object somehow, which consists only of a space character (" "),
then the remote procedure is called with a string object consisting of
empty string (""). So the space character within the string gets
somehow lost during the remote call.
I'm not really sure if I'm using the XML-RPC.NET library in the wrong
way, or if there the library has a problem handling string objects
consisting of only a single space character. But after looking over
the source code and doing some unit testing it seems as if the problem
occurres during deserialization.
For example following unit test fails:
[Test]
public void StringElementSpaceCharacter()
{
string xml = @"<?xml version=""1.0"" ?>
<methodCall>
<methodName>TestString</methodName>
<params>
<param>
<value><string> </string></value>
</param>
</params>
</methodCall>";
StringReader sr = new StringReader(xml);
XmlRpcSerializer serializer = new XmlRpcSerializer();
XmlRpcRequest request = serializer.DeserializeRequest(sr, null);
Assert.AreEqual(request.method, "TestString", "method is
TestString");
Assert.AreEqual(request.args[0].GetType(), typeof(string),
"argument is string");
Assert.AreEqual((string)request.args[0], " ",
"argument is ' '");
}
Perhaps someone could tell me what I'm doing wrong or if there's a bug
within the library.
Best regards,
Florian
Hi Florian: thanks for reporting this. I'll release a fix for this in
a couple of days.
The problem occurs with any string value containing one or more spaces
only (caused by the instance of XmlDocument being used by the
deserializing code having a default value of false for its
PreserveWhiteSpace property).
:Charles
--- In XMLRPCNET@yahoogroups.com, "psysp80" <mail@...> wrote:
>
> Hello,
>
> I'm currently playing a little bit with the XML-RPC.NET library to
> call some remote procedures.
>
> Every time I call a remote procedure with a parameter containing a
> string object somehow, which consists only of a space character (" "),
> then the remote procedure is called with a string object consisting of
> empty string (""). So the space character within the string gets
> somehow lost during the remote call.
>
> I'm not really sure if I'm using the XML-RPC.NET library in the wrong
> way, or if there the library has a problem handling string objects
> consisting of only a single space character. But after looking over
> the source code and doing some unit testing it seems as if the problem
> occurres during deserialization.
>
> For example following unit test fails:
>
> [Test]
> public void StringElementSpaceCharacter()
> {
> string xml = @"<?xml version=""1.0"" ?>
> <methodCall>
> <methodName>TestString</methodName>
> <params>
> <param>
> <value><string> </string></value>
> </param>
> </params>
> </methodCall>";
> StringReader sr = new StringReader(xml);
> XmlRpcSerializer serializer = new XmlRpcSerializer();
> XmlRpcRequest request = serializer.DeserializeRequest(sr,
null);
>
> Assert.AreEqual(request.method, "TestString", "method is
> TestString");
> Assert.AreEqual(request.args[0].GetType(), typeof(string),
> "argument is string");
> Assert.AreEqual((string)request.args[0], " ",
> "argument is ' '");
> }
>
>
> Perhaps someone could tell me what I'm doing wrong or if there's a bug
> within the library.
>
> Best regards,
> Florian
>
Updated version of release 2.3 here.
http://xmlrpcnet.googlecode.com/files/xml-rpc.net.2.3.2.zip
Changes:
* Issue 22: XmlRpcTypeMismatchException thrown if an XML-RPC array is
mistakenly mapped onto a .Net struct (was throwing
MissingMethodException).
* Issue 23: Fixes problem where XML-RPC string values containing just
one or more spaces were deserialized as an empty .Net string value.
* Issue 24: XmlRpcV2 assembly is now built with a strong name.
--- In XMLRPCNET@yahoogroups.com, "charlescookuk" <chascook@...> wrote:
>
> Hi Florian: thanks for reporting this. I'll release a fix for this in
> a couple of days.
>
> The problem occurs with any string value containing one or more spaces
> only (caused by the instance of XmlDocument being used by the
> deserializing code having a default value of false for its
> PreserveWhiteSpace property).
>
> :Charles
>
> --- In XMLRPCNET@yahoogroups.com, "psysp80" <mail@> wrote:
> >
> > Hello,
> >
> > I'm currently playing a little bit with the XML-RPC.NET library to
> > call some remote procedures.
> >
> > Every time I call a remote procedure with a parameter containing a
> > string object somehow, which consists only of a space character (" "),
> > then the remote procedure is called with a string object consisting of
> > empty string (""). So the space character within the string gets
> > somehow lost during the remote call.
> >
> > I'm not really sure if I'm using the XML-RPC.NET library in the wrong
> > way, or if there the library has a problem handling string objects
> > consisting of only a single space character. But after looking over
> > the source code and doing some unit testing it seems as if the problem
> > occurres during deserialization.
> >
> > For example following unit test fails:
> >
> > [Test]
> > public void StringElementSpaceCharacter()
> > {
> > string xml = @"<?xml version=""1.0"" ?>
> > <methodCall>
> > <methodName>TestString</methodName>
> > <params>
> > <param>
> > <value><string> </string></value>
> > </param>
> > </params>
> > </methodCall>";
> > StringReader sr = new StringReader(xml);
> > XmlRpcSerializer serializer = new XmlRpcSerializer();
> > XmlRpcRequest request = serializer.DeserializeRequest(sr,
> null);
> >
> > Assert.AreEqual(request.method, "TestString", "method is
> > TestString");
> > Assert.AreEqual(request.args[0].GetType(), typeof(string),
> > "argument is string");
> > Assert.AreEqual((string)request.args[0], " ",
> > "argument is ' '");
> > }
> >
> >
> > Perhaps someone could tell me what I'm doing wrong or if there's a bug
> > within the library.
> >
> > Best regards,
> > Florian
> >
>
Hello all,
I am new to xml-rpc.net and I am having a problem. We are developing
an API that receives xml-rpc responses from a 3rd party server. Most
of the reposnes contain structs within structs, i.e. some values are
structs.
Example:-
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>message</name>
<value>success at Fri Mar 16 02:32:53 GMT 2007</value>
</member>
<member>
<name>result</name>
<value><i4>0</i4></value>
</member>
<member>
<name>balance</name>
<value>
<struct>
<member>
<name>amount</name>
<value><i4>1022200</i4></value>
</member>
<member>
<name>currency</name>
<value>GBP</value>
</member>
</struct>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
As you can see the "balance" member's values is a struct. The
CookComputing Serializer throws throws a "response contains struct
value with missing non-optional member:..." exception when I try to
map to a struct that contains an instance of another struct to hold
the balance member. Here are the 2 structs:-
public struct UserBalanceResponse
{
public BalanceResponse balResp;
public string message;
public int result;
}
public struct BalanceResponse
{
public int amount;
public string currency;
}
If I remove the instance of BalanceResponse from UserBalanceResponse
the message and result members are returned without any problems. The
serializer doesnt like the struct within a struct.
Does CookComputing library deal with responses like this and if so
can anoyone help me out ??
Thanks,
Sean
The struct member is "balance" in the response but you have defined it
as "balResp" in the .NET definition.
:Charles
--- In XMLRPCNET@yahoogroups.com, "mclaughlin.seanp"
<mclaughlin.seanp@...> wrote:
>
> Hello all,
>
> I am new to xml-rpc.net and I am having a problem. We are developing
> an API that receives xml-rpc responses from a 3rd party server. Most
> of the reposnes contain structs within structs, i.e. some values are
> structs.
>
> Example:-
> <methodResponse>
> <params>
> <param>
> <value>
> <struct>
> <member>
> <name>message</name>
> <value>success at Fri Mar 16 02:32:53 GMT 2007</value>
> </member>
> <member>
> <name>result</name>
> <value><i4>0</i4></value>
> </member>
> <member>
> <name>balance</name>
> <value>
> <struct>
> <member>
> <name>amount</name>
> <value><i4>1022200</i4></value>
> </member>
> <member>
> <name>currency</name>
> <value>GBP</value>
> </member>
> </struct>
> </value>
> </member>
> </struct>
> </value>
> </param>
> </params>
> </methodResponse>
>
> As you can see the "balance" member's values is a struct. The
> CookComputing Serializer throws throws a "response contains struct
> value with missing non-optional member:..." exception when I try to
> map to a struct that contains an instance of another struct to hold
> the balance member. Here are the 2 structs:-
>
> public struct UserBalanceResponse
> {
> public BalanceResponse balResp;
> public string message;
> public int result;
> }
>
> public struct BalanceResponse
> {
> public int amount;
> public string currency;
> }
>
>
> If I remove the instance of BalanceResponse from UserBalanceResponse
> the message and result members are returned without any problems. The
> serializer doesnt like the struct within a struct.
>
> Does CookComputing library deal with responses like this and if so
> can anoyone help me out ??
>
> Thanks,
> Sean
>
What a stupid oversight.
Thanks Charles :)
--- In XMLRPCNET@yahoogroups.com, "charlescookuk" <chascook@...> wrote:
>
> The struct member is "balance" in the response but you have defined it
> as "balResp" in the .NET definition.
>
> :Charles
>
hi, I need to access a RPC server. which protected by another Apach
web server. first user access Apache web server, once submit
username/password, then transfer to RPC server.
follow are my code. but when I call RPC method, always return login
page, seems Credentials nod work. anyone have any idea.
Thanks
MYxmlrpc m_myXmlRpc =
(MYxmlrpc)XmlRpcProxyGen.Create(typeof(MYxmlrpc));
string certificateName = "certificateName";
X509Store store = new X509Store(StoreName.Root);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certificates =
store.Certificates.Find(X509FindType.FindByIssuerName,
certificateName, true);
X509Certificate certificate = certificates[0];
m_myXmlRpc.Credentials = new NetworkCredential("username",
"password");
m_myXmlRpc.PreAuthenticate = true;
m_AIAXmlRpc.cllrpctestmethod("hellow");
I am totally new to XML-RPC, rather started today. The response
structure of XML-RPC server is
<?xml version="1.0" encoding="iso-8859-1" ?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>period</name>
<value><string> </string></value>
<name>arrival-date</name>
<value><string> </string></value>
<name>arrival-time-from</name>
<value><string> </string></value>
<name>arrival-time-until</name>
<value><string> </string></value>
<name>departure-date</name>
<value><string> </string></value>
<name>departure-time</name>
<value><string> </string></value>
<name>booking-on-request</name>
<value><string> </string></value>
<name>rent-price</name>
<value><string> </string></value>
<name>rent-price-excl-discount</name>
<value><string> </string></value>
<name>cs</name>
<value><string> </string></value>
</member>
<member>
<name>period</name>
<value><string> </string></value>
<name>arrival-date</name>
<value><string> </string></value>
<name>arrival-time-from</name>
<value><string> </string></value>
<name>arrival-time-until</name>
Euro Relais partner guide – XML RPC 14/68
<value><string> </string></value>
<name>departure-date</name>
<value><string> </string></value>
<name>departure-time</name>
<value><string> </string></value>
<name>booking-on-request</name>
<value><string> </string></value>
<name>rent-price</name>
<value><string> </string></value>
<name>rent-price-excl-discount</name>
<value><string> </string></value>
<name>cs</name>
<value><string> </string></value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
I have defined the struct like this:
public struct Plan
{
[XmlRpcMember("period")]
public string period;
[XmlRpcMember("arrival-date")]
public string arrivaldate;
[XmlRpcMember("arrival-time-from")]
public string arrivaltimefrom;
[XmlRpcMember("arrival-time-until")]
public string arrivaltimeuntil;
[XmlRpcMember("departure-date")]
public string departuredate;
[XmlRpcMember("departure-time")]
public string departuretime;
[XmlRpcMember("booking-on-request")]
public string bookingonrequest;
[XmlRpcMember("rent-price")]
public string rentprice;
[XmlRpcMember("rent-price-excl-discount")]
public string rentpriceexcldiscount;
[XmlRpcMember("cs")]
public string cs;
}
How should I receieve the response from proxy call?
hello everybody,
I am trying to to launch a XML-RPC server on a Pocket PC but it isn't
working since it needs the remoting libraries which are not available
on compact framework...
Does anybody got an idea on how I can bypass this problem??
Thanks in advance.
Audric Podmilsak
Hi, I have a client(c# and xml-rpc.net) will call a server (this
server protected by NetPoint or CoreID). Are there any one have any
idea how my client can cross (oracle NetPoint or oracle CoreID )
Following is my code:
MYxmlrpc m_myXmlRpc =
(MYxmlrpc)XmlRpcProxyGen.Create(typeof(MYxmlrpc));
string certificateName = "certificateName";
X509Store store = new X509Store(StoreName.Root);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certificates =
store.Certificates.Find(X509FindType.FindByIssuerName,
certificateName, true);
X509Certificate certificate = certificates[0];
m_myXmlRpc.Credentials = new NetworkCredential("username",
"password");
m_myXmlRpc.PreAuthenticate = true;
m_AIAXmlRpc.cllrpctestmethod("hellow");
When I call m_AIAXmlRpc.cllrpctestmethod("hellow"); always redirect to
login page
Thanks
Hi - I've implemented a server as an .ASHX file within an ASP.Net
website (based upon http://www.xml-rpc.net/faq/xmlrpcnetfaq.html#3.11
only in C#) and am attempting to make use of it from a Python client
(using xmlrpclib). I would appreciate some reassurance on the the way
that ASHX based servers should be addressed by clients.
When I try to use the service I'm getting a response "socket.error:
(10061, 'Connection refused')" and I just wanted to check that the way
I was addressing the server (given that I'm using an ASHX) was correct.
I've got an .ASHX that looks like this ...
<%@ WebHandler Language="C#" Class="BinaryResourceSupport" %>
<%@ Assembly Name="CookComputing.XmlRpcV2" %>
using System;
using System.Web;
using System.IO;
using CookComputing.XmlRpc;
using TCG.ABC.BO;
using TCG.ABC.BLL;
using TCG.ABC.DAL;
public class BinaryResourceSupport : XmlRpcService
{
[XmlRpcMethod("TCG.ABC.WebServices.GetPage2PDF")]
public BinaryResource GetPage2PDF()
{
string strFullPath = "C:\\TESTFILE.PDF";
BinaryResource objBR = new BinaryResource();
objBR.ID = -1;
objBR.Type = BinaryResourceType.AcrobatPDF;
objBR.Resource = ReadFile(strFullPath);
return objBR;
}
}
... and this is implemented in a file called BinaryResourceSupport.ashx.
... if, in Visual Studio, I open this file for debug I see a URL used
which looks like this ...
http://localhost:3467/CRRUI/BinaryResourceSupport.ashx
... still in debug if I click on the methods displayed I see a URL of :
http://localhost:3467/CRRUI/BinaryResourceSupport.ashx#TCG.ABC.WebServices.GetPa\
ge2PDF
... When I try to make use of GetPage2PDF from the Python client I
reference a server name of ...
http://192.168.10.15:3467/CRRUI/BinaryResourceSupport.ashx
... (substituting the real IP for 'localhost' (actually I started off
using http://192.168.10.15:3467/ but that gave me 'protocol error')
and a method name of ...
'TCG.ABC.WebServices.GetPage2PDF'.
I'm not asking for advice on the python side but I just wanted to
check that the broad idea of how to address the ASHX based server was
correct ? (By the way the server and client are on the same machine).
Appreciate any advice/reassurance.
Richard.