Search the web
Sign In
New User? Sign Up
XMLRPCNET · XML-RPC.NET
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 1 - 31 of 1226   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#31 From: "charlescookuk" <charlescook@...>
Date: Sun Jul 14, 2002 3:38 pm
Subject: Re: Method name with a '.' in it.
charlescookuk
Offline Offline
Send Email Send Email
 
Hi Richard - any string can be used in the XmlRpcMethod attribute
constructor to specify the name of the XML-RPC method to be called,
for example:

class SumAndDiffProxy : XmlRpcClientProtocol
{
   [XmlRpcMethod("samples.sumAndDifference")]
   SumAndDiffValue SumAndDifference(int x, int y)
   {
     return (SumAndDiffValue)Invoke("SumAndDifference",
                                    new Object[]{ x, y });
   }
}

In this case the resulting XML-RPC request XML document will contain:

<methodName>samples.sumAndDifference</methodName>

So you should not have a problem with XML-RPC method names such
as 'Send.SMS' and 'Create.Fleet'.

- Charles

--- In XMLRPCNET@y..., "Richard Thurbin" <richard.thurbin@a...> wrote:
> Thanks Charles for the pointers on where I was going wrong.
>
> I sorted it by making all the 'Login' keywords to be the same:
>
> <XmlRpcMethod("Login")> Public Function Login(ByVal Username As
String,
> ByVal Password As String) As String
>         Return xmlRpcClient.Invoke(Me, "Login", New Object()
{Username,
> Password})
> End Function
>
>
> The company we are RPC'ing to has called all its method names
things like
> 'Send.SMS' and 'Create.Fleet'. Am I right in thinking that the '.'
in the
> method names means it is not compatible with allowed .NET method
names, and
> do you know if I can work around this?
>
>
> Thanks for your help.
>
> Thanks,
> Richard Thurbin
> Software Developer
> Phone: 01223 728 718
> Mail:  richard.thurbin@a...
> Web:   www.acis-cam.uk.com
>
> ACIS Research and Development
> Deanland House
> 2nd Floor
> Cowley Road
> Cambridge CB4 0DL
>
> -----Original Message-----
> From: charlescookuk [mailto:charlescook@u...]
> Sent: 11 July 2002 21:05
> To: XMLRPCNET@y...
> Subject: [XMLRPCNET] Re: Please help: System.Exception: Invoke on
> non-existent proxy method
>
>
> Hi Richard - could you confirm that the first parameter passed to
> Invoke is the name of the proxy method, and not the name of the XML-
> RPC method being called (if different) or just mis-spelt?
>
> - Charles
>
>
> --- In XMLRPCNET@y..., "Richard Thurbin" <richard.thurbin@a...>
wrote:
> > I am getting the following error when trying to call a RPC.
> >
> > Unhandled Exception: The thread 'MainGFRLoop' (0x310) has exited
> with code 0
> > (0x0).
> > System.Exception: Invoke on non-existent proxy method
> >    at CookComputing.XmlRpc.XmlRpcClientProtocol.GetRpcMethodName
> (Object
> > clientObj, String MethodName)
> >    at CookComputing.XmlRpc.XmlRpcClientProtocol.MakeXmlRpcRequest
> (WebRequest
> > webReq, String methodName, Object[] parameters, Object clientObj)
> >    at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object
> clientObj,
> > String methodName, Object[] parameters)
> >    at SMSClient.SMSLocaVista.LoginSMS(String Username, String
> Password) in
> > D:\Source\SMSClient\SMSLocaVista.vb:line 88
> >    at SMSClient.SMSLocaVista.SortOutLogin() in
> > D:\Source\SMSClient\SMSLocaVista.vb:line 235
> >    at SMSClient.SMSLocaVista.MainLVLoop() in
> > D:\Source\SMSClient\SMSLocaVista.vb:line 114
> >
> > Am I right in thinking this is not a method implemented at the
> other end?
> >
> > Thanks,
> > Richard Thurbin
> > Software Developer
> > Phone: 01223 728 718
> > Mail:  richard.thurbin@a...
> > Web:   www.acis-cam.uk.com
> >
> > ACIS Research and Development
> > Deanland House
> > 2nd Floor
> > Cowley Road
> > Cambridge CB4 0DL
>
>
> Yahoo! Groups Sponsor
>
>
> To unsubscribe from this group, send an email to:
> XMLRPCNET-unsubscribe@y...
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

#30 From: "Richard Thurbin" <richard.thurbin@...>
Date: Sat Jul 13, 2002 3:10 pm
Subject: Method name with a '.' in it.
rthurbinuk
Offline Offline
Send Email Send Email
 
Thanks Charles for the pointers on where I was going wrong.

I sorted it by making all the 'Login' keywords to be the same:

<XmlRpcMethod("Login")> Public Function Login(ByVal Username As String,
ByVal Password As String) As String
         Return xmlRpcClient.Invoke(Me, "Login", New Object() {Username,
Password})
End Function


The company we are RPC'ing to has called all its method names things like
'Send.SMS' and 'Create.Fleet'. Am I right in thinking that the '.' in the
method names means it is not compatible with allowed .NET method names, and
do you know if I can work around this?


Thanks for your help.

Thanks,
Richard Thurbin
Software Developer
Phone: 01223 728 718
Mail:  richard.thurbin@...
Web:   www.acis-cam.uk.com

ACIS Research and Development
Deanland House
2nd Floor
Cowley Road
Cambridge CB4 0DL

-----Original Message-----
From: charlescookuk [mailto:charlescook@...]
Sent: 11 July 2002 21:05
To: XMLRPCNET@yahoogroups.com
Subject: [XMLRPCNET] Re: Please help: System.Exception: Invoke on
non-existent proxy method


Hi Richard - could you confirm that the first parameter passed to
Invoke is the name of the proxy method, and not the name of the XML-
RPC method being called (if different) or just mis-spelt?

- Charles


--- In XMLRPCNET@y..., "Richard Thurbin" <richard.thurbin@a...> wrote:
> I am getting the following error when trying to call a RPC.
>
> Unhandled Exception: The thread 'MainGFRLoop' (0x310) has exited
with code 0
> (0x0).
> System.Exception: Invoke on non-existent proxy method
>    at CookComputing.XmlRpc.XmlRpcClientProtocol.GetRpcMethodName
(Object
> clientObj, String MethodName)
>    at CookComputing.XmlRpc.XmlRpcClientProtocol.MakeXmlRpcRequest
(WebRequest
> webReq, String methodName, Object[] parameters, Object clientObj)
>    at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object
clientObj,
> String methodName, Object[] parameters)
>    at SMSClient.SMSLocaVista.LoginSMS(String Username, String
Password) in
> D:\Source\SMSClient\SMSLocaVista.vb:line 88
>    at SMSClient.SMSLocaVista.SortOutLogin() in
> D:\Source\SMSClient\SMSLocaVista.vb:line 235
>    at SMSClient.SMSLocaVista.MainLVLoop() in
> D:\Source\SMSClient\SMSLocaVista.vb:line 114
>
> Am I right in thinking this is not a method implemented at the
other end?
>
> Thanks,
> Richard Thurbin
> Software Developer
> Phone: 01223 728 718
> Mail:  richard.thurbin@a...
> Web:   www.acis-cam.uk.com
>
> ACIS Research and Development
> Deanland House
> 2nd Floor
> Cowley Road
> Cambridge CB4 0DL


Yahoo! Groups Sponsor


To unsubscribe from this group, send an email to:
XMLRPCNET-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

#29 From: "charlescookuk" <charlescook@...>
Date: Thu Jul 11, 2002 8:04 pm
Subject: Re: Please help: System.Exception: Invoke on non-existent proxy method
charlescookuk
Offline Offline
Send Email Send Email
 
Hi Richard - could you confirm that the first parameter passed to
Invoke is the name of the proxy method, and not the name of the XML-
RPC method being called (if different) or just mis-spelt?

- Charles


--- In XMLRPCNET@y..., "Richard Thurbin" <richard.thurbin@a...> wrote:
> I am getting the following error when trying to call a RPC.
>
> Unhandled Exception: The thread 'MainGFRLoop' (0x310) has exited
with code 0
> (0x0).
> System.Exception: Invoke on non-existent proxy method
>    at CookComputing.XmlRpc.XmlRpcClientProtocol.GetRpcMethodName
(Object
> clientObj, String MethodName)
>    at CookComputing.XmlRpc.XmlRpcClientProtocol.MakeXmlRpcRequest
(WebRequest
> webReq, String methodName, Object[] parameters, Object clientObj)
>    at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object
clientObj,
> String methodName, Object[] parameters)
>    at SMSClient.SMSLocaVista.LoginSMS(String Username, String
Password) in
> D:\Source\SMSClient\SMSLocaVista.vb:line 88
>    at SMSClient.SMSLocaVista.SortOutLogin() in
> D:\Source\SMSClient\SMSLocaVista.vb:line 235
>    at SMSClient.SMSLocaVista.MainLVLoop() in
> D:\Source\SMSClient\SMSLocaVista.vb:line 114
>
> Am I right in thinking this is not a method implemented at the
other end?
>
> Thanks,
> Richard Thurbin
> Software Developer
> Phone: 01223 728 718
> Mail:  richard.thurbin@a...
> Web:   www.acis-cam.uk.com
>
> ACIS Research and Development
> Deanland House
> 2nd Floor
> Cowley Road
> Cambridge CB4 0DL

#28 From: "Richard Thurbin" <richard.thurbin@...>
Date: Thu Jul 11, 2002 5:25 pm
Subject: Please help: System.Exception: Invoke on non-existent proxy method
rthurbinuk
Offline Offline
Send Email Send Email
 
I am getting the following error when trying to call a RPC.

Unhandled Exception: The thread 'MainGFRLoop' (0x310) has exited with code 0
(0x0).
System.Exception: Invoke on non-existent proxy method
    at CookComputing.XmlRpc.XmlRpcClientProtocol.GetRpcMethodName(Object
clientObj, String MethodName)
    at CookComputing.XmlRpc.XmlRpcClientProtocol.MakeXmlRpcRequest(WebRequest
webReq, String methodName, Object[] parameters, Object clientObj)
    at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj,
String methodName, Object[] parameters)
    at SMSClient.SMSLocaVista.LoginSMS(String Username, String Password) in
D:\Source\SMSClient\SMSLocaVista.vb:line 88
    at SMSClient.SMSLocaVista.SortOutLogin() in
D:\Source\SMSClient\SMSLocaVista.vb:line 235
    at SMSClient.SMSLocaVista.MainLVLoop() in
D:\Source\SMSClient\SMSLocaVista.vb:line 114

Am I right in thinking this is not a method implemented at the other end?

Thanks,
Richard Thurbin
Software Developer
Phone: 01223 728 718
Mail:  richard.thurbin@...
Web:   www.acis-cam.uk.com

ACIS Research and Development
Deanland House
2nd Floor
Cowley Road
Cambridge CB4 0DL

#27 From: "charlescookuk" <charlescook@...>
Date: Wed Jun 19, 2002 5:12 pm
Subject: Deserialization Bug
charlescookuk
Offline Offline
Send Email Send Email
 
If you use XML-RPC.NET please note the following bug.

If an array occurs in a position in an XML-RPC request or response
where the type of its elements is not known <b>AND</b> one or more of
its elements is a string specified without the <string> element, an
exception is incorrectly thrown by the deserializer. The response
below is an example of where the problem occurs.

The two string instances are in an array member of a struct and no
type information is available to the serializer. (In this case the
array should be parsed into an array of type Object[].)

I'll release a fix for this in the next day or two.

<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>key3</name>
<value>
<array>
<data>
<value>New Milk</value>
<value>Old Milk</value>
</data>
</array>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>

#26 From: "charlescookuk" <charlescook@...>
Date: Wed Jun 12, 2002 1:19 pm
Subject: Re: Xindice-XMLRPC, anyone?
charlescookuk
Offline Offline
Send Email Send Email
 
This line causes the problem:

            Dim param(1) As Object

It actually defines a 2 element array! The 2nd element ends up
containing null when Invoke is called. The following works:

            Dim param(0) As Object

I've made a note to handle this VB.NET quirk in the next version of
the library.

- Charles

--- In XMLRPCNET@y..., "perry_ismangil" <ismangil@a...> wrote:
>
> I am trying to access Xindice from VB.NET, via XML-RPC.
>
> I have tested the Xindice-XMLRPC using Java clients and it works.
>
> I am now trying with XMLRPC.Net and all I got was Null pointers
> exception when I do 'Invoke'. Here is the code:
>
> <CookComputing.XmlRpc.XmlRpcUrl("http://localhost:4080/")> _
>    Public Class Xindice
>       Inherits CookComputing.XmlRpc.XmlRpcClientProtocol
>
>    <CookComputing.XmlRpc.XmlRpcMethod("db.listCollections")> _
>    Public Function listCollections(ByVal name As String) As String()
>           Dim coll() As String = {}
>           Dim param(1) As Object
>           Dim result As Object()
>
>           param(0) = New String(name)
>
>           Invoke("listCollections", param)
>
>
>           Return coll
>
>    End Function
>
> Thanks

#25 From: "perry_ismangil" <ismangil@...>
Date: Wed Jun 12, 2002 11:51 am
Subject: Xindice-XMLRPC, anyone?
perry_ismangil
Offline Offline
Send Email Send Email
 
I am trying to access Xindice from VB.NET, via XML-RPC.

I have tested the Xindice-XMLRPC using Java clients and it works.

I am now trying with XMLRPC.Net and all I got was Null pointers
exception when I do 'Invoke'. Here is the code:

<CookComputing.XmlRpc.XmlRpcUrl("http://localhost:4080/")> _
    Public Class Xindice
       Inherits CookComputing.XmlRpc.XmlRpcClientProtocol

    <CookComputing.XmlRpc.XmlRpcMethod("db.listCollections")> _
    Public Function listCollections(ByVal name As String) As String()
           Dim coll() As String = {}
           Dim param(1) As Object
           Dim result As Object()

           param(0) = New String(name)

           Invoke("listCollections", param)


           Return coll

    End Function

Thanks

#24 From: "charlescookuk" <charlescook@...>
Date: Sat May 11, 2002 10:12 pm
Subject: Re: dateTime error ?
charlescookuk
Offline Offline
Send Email Send Email
 
Hi Simon - the XML-RPC spec is a bit vague in this area, to say the
least. It says the dateTime format is ISO 8601 but does not take into
account that this standard specfies several different formats.

My understanding is that dateTimes in XML-RPC should always be of this
format:

YYYYMMDDTHH:mm:SS

i.e. without timezone, and no hyphens between YYYYMMDD (which is
allowed by ISO 8601). This is the position taken in the book
"Programming Web Services with XML-RPC".

So the current XML-RPC.NET implementation is strictly adhering to the
XML-RPC standard. I suppose I should really implement XML-RPC.NET to
accept different formats but only output the format above.

- Charles


--- In XMLRPCNET@y..., "simonfell99" <soap@z...> wrote:
> I'm trying to send a dateTime to a XML-RPC.NET server as
> <dateTime.iso8601>2002-05-11T12:48:37Z</dateTime.iso8601>
>
> but i get this error
> HTTP/1.1 400 dateTime element is invalid.
>
> AFAICS Its a valid iso8601 date, is it not expecting to get a TZ
> trailer ? [i notice the examples in the spec don't show timezones]
>
> Thanks
> Simon

#23 From: "simonfell99" <soap@...>
Date: Sat May 11, 2002 7:52 pm
Subject: dateTime error ?
simonfell99
Offline Offline
Send Email Send Email
 
I'm trying to send a dateTime to a XML-RPC.NET server as
<dateTime.iso8601>2002-05-11T12:48:37Z</dateTime.iso8601>

but i get this error
HTTP/1.1 400 dateTime element is invalid.

AFAICS Its a valid iso8601 date, is it not expecting to get a TZ
trailer ? [i notice the examples in the spec don't show timezones]

Thanks
Simon

#22 From: "charlescookuk" <charlescook@...>
Date: Wed May 8, 2002 6:48 am
Subject: Missing Key File
charlescookuk
Offline Offline
Send Email Send Email
 
I've received a couple of emails about a missing key file if you try
to build XML-RPC.NET from the distribution. The problem is that I've
generated my own key file using sn.exe (Strong Name Utility) and I
want to reserve this for use only with assemblies I distribute.
Therefore CookComputing.key is not included in the distribution. The
workaround is to either generate your own key file using sn.exe or
comment out the following line in AssemblyInfo.cs:

[assembly: AssemblyKeyFile("..\\..\\..\\CookComputing.key")]

#21 From: "charlescookuk" <charlescook@...>
Date: Mon May 6, 2002 3:49 pm
Subject: Problems with RealProxy [Correction]
charlescookuk
Offline Offline
Send Email Send Email
 
Re earlier posting about generating proxies automatically using the
RealProxy class, it won't work unless the code is running with extra
security permissions or full trust. Issues described in more detail
here:

http://www.cookcomputing.com/archive/2002_05_01_archive.html#76222164

#19 From: "charlescookuk" <charlescook@...>
Date: Sun Apr 28, 2002 9:40 pm
Subject: XML-RPC.NET Release 0.5.0 - .NET Remoting
charlescookuk
Offline Offline
Send Email Send Email
 
I received Ingo Rammer's excellent book Advanced .NET Remoting from
Amazon a few days ago and this was the spur I needed to experiment
with .NET Remoting. After a couple of long coding sessions this
weekend I've released version 0.5.0 of XML-RPC.NET which contains XML-
RPC client and server formatter sinks. These enable the .NET remoting
infrastructure to be used to implement both XML-RPC clients and
servers. In addition, the server-side formatter can be configured so
that a server can simultaneously support both XML-RPC and SOAP
requests. If the XML-RPC formatter detects an incoming request is a
SOAP request, it forwards the request to the default SOAP formatter;
otherwise it processes the request as an XML-RPC request.

Some preliminary documentation on .NET Remoting is included on the
Samples page. It should be noted that the XML-RPC formatter is not
intended to replace SOAP when making calls between .NET clients. The
XML-RPC serialization code is designed for use with XML-RPC
parameters and is not as comprehensive as the built-in SOAP
serialization code, so there wouldn't be much point in using XML-RPC
in this scenario.The XML-RPC formatter is instead intended to be used
where either client or server is not based on .NET Remoting and XML-
RPC is being used, or where a server is required to handle both SOAP
and XML-RPC requests.

http://www.cookcomputing.com/xmlrpc/

http://www.cookcomputing.com/xmlrpc/xmlrpcsamples.html

#18 From: "charlescookuk" <charlescook@...>
Date: Sat Apr 20, 2002 7:32 pm
Subject: .NET struct Parameters and Return Values
charlescookuk
Offline Offline
Send Email Send Email
 
When using a .NET struct type as a parameter or return value, the
members of the struct must be declared as public or else they will be
ignored. For example, both the members in this struct will be
serialized/deserialized:

public struct myStructA
{
   public int x;
   public string s;
}

but only member x will be serialized/deserialized in this struct:

public struct myStructB
{
   public int x;
   string s;
}


This is because XML-RPC.NET uses the System.Type.GetMembers method to
determine which member variables should be serialized/deserialized
from/to a struct and this method only returns information about
public members.

I believe it is possible to reflect on private members but I think
that requires extra security permissions which, for example, means
that the XML-RPC.NET assembly could not be used in the default
Internet security zone (say as a component used by a
downloadable "smart client", or by a control on a web page).

#17 From: "charlescookuk" <charlescook@...>
Date: Fri Apr 19, 2002 6:29 pm
Subject: Sample Code - Blogger API (Part 2)
charlescookuk
Offline Offline
Send Email Send Email
 
This is some test code for the proxy class in part one of this sample.

using System;
using CookComputing.XmlRpc;
using CookComputing.XmlRpc.BloggerAPI;

class _
{
   static string myAppkey = "*********";
   static string myPwd = "*******";
   static string myBlogid = "******";
   static string myName = "******";

   static void TestNewPost()
   {
     BloggerAPI blogger = new BloggerAPI();
     string contents = "This is a post from XML-RPC.NET";

     string uniqID = blogger.NewPost(myAppkey, myBlogid, myName,
       myPwd, contents, false);
     Console.WriteLine("uniqID is {0}", uniqID);
   }

   static void TestGetUsersBlogs()
   {
     BloggerAPI blogger = new BloggerAPI();
     UserBlog[] userBlogs = blogger.GetUsersBlogs(myAppkey, myName,
       myPwd);
     foreach (UserBlog blog in userBlogs)
     {
       Console.WriteLine("{0} {1} {2}",
         blog.blogid, blog.blogName, blog.url);
     }
   }

   static void TestGetUserInfo()
   {
     BloggerAPI blogger = new BloggerAPI();
     UserInfo userInfo = blogger.GetUserInfo(myAppkey, myName,
       myPwd);
     Console.WriteLine("userid: {0}", userInfo.userid);
     Console.WriteLine("firstname: {0}", userInfo.firstname);
     Console.WriteLine("lastname: {0}", userInfo.lastname);
     Console.WriteLine("nickname: {0}", userInfo.nickname);
     Console.WriteLine("email: {0}", userInfo.email);
     Console.WriteLine("url: {0}", userInfo.url);
   }

   static void TestGetTemplate()
   {
     BloggerAPI blogger = new BloggerAPI();
     string templateType = "main";

     string template = blogger.GetTemplate(myAppkey, myBlogid,
       myName, myPwd, templateType);
     Console.WriteLine(template);
   }

   static void TestGetRecentPosts()
   {
     BloggerAPI blogger = new BloggerAPI();

     RecentPost[] posts = blogger.GetRecentPosts(myAppkey, myBlogid,
       myName, myPwd, 10);
     foreach (RecentPost post in posts)
     {
       Console.WriteLine("dateCreated: {0}", post.dateCreated);
       Console.WriteLine("userid: {0}", post.userid);
       Console.WriteLine("postid: {0}", post.postid);
       Console.WriteLine("content: {0}", post.content);
     }
   }

   static void TestEditPost()
   {
     BloggerAPI blogger = new BloggerAPI();
     string postid = "755954347";
     string contents = "Changed posting at " + DateTime.Now;
     bool ret = blogger.EditPost(myAppkey, postid, myName, myPwd,
       contents, true);
     Console.WriteLine("result is {0}", ret);
   }

   [STAThread]
   static void Main(string[] args)
   {
     TestNewPost();
     TestGetUsersBlogs();
     TestGetUserInfo();
     TestGetTemplate();
     TestGetRecentPosts();
     TestEditPost();
     Console.ReadLine();
   }
}

#16 From: "charlescookuk" <charlescook@...>
Date: Fri Apr 19, 2002 6:13 pm
Subject: Sample Code - Blogger API (Part 1)
charlescookuk
Offline Offline
Send Email Send Email
 
Given that Blogger is probably the most interesting public XML-RPC
service available, here is a sample proxy class. A test client using
this proxy will follow shortly.

I'm not having much luck with the GetUserInfo method at the moment.
The Blogger service returns a fault response describing a Java
exception.


using System;
using CookComputing.XmlRpc;

namespace CookComputing.XmlRpc.BloggerAPI
{
   public struct UserBlog
   {
     public string blogid;
     public string blogName;
     public string url;
   }

   public struct UserInfo
   {
     public string userid;
     public string firstname;
     public string lastname;
     public string nickname;
     public string email;
     public string url;
   }

   public struct RecentPost
   {
     public DateTime dateCreated;
     public string userid;
     public string postid;
     public string content;
   }

   [XmlRpcUrl("http://plant.blogger.com/api/RPC2")]
   public class BloggerAPI : XmlRpcClientProtocol
   {
     [XmlRpcMethod("blogger.newPost")]
     public string NewPost(
       string appkey,
       string blogid,
       string username,
       string password,
       string contents,
       bool publish)
     {
       return (string)Invoke("NewPost", new object[]
           {appkey, blogid, username, password, contents, publish});
     }

     [XmlRpcMethod("blogger.editPost")]
     public bool EditPost(
       string appkey,
       string postid,
       string username,
       string password,
       string contents,
       bool publish)
     {
       return (bool)Invoke("EditPost", new object[]
           {appkey, postid, username, password, contents, publish});
     }

     [XmlRpcMethod("blogger.getUsersBlogs")]
     public UserBlog[] GetUsersBlogs(
       string appkey,
       string username,
       string password)
     {
       return (UserBlog[])Invoke("GetUsersBlogs", new object[]
           {appkey, username, password});
     }

     [XmlRpcMethod("blogger.getUserInfo")]
     public UserInfo GetUserInfo(
       string appkey,
       string username,
       string password)
     {
       return (UserInfo)Invoke("GetUserInfo", new object[]
           {appkey, username, password});
     }

     [XmlRpcMethod("blogger.getTemplate")]
     public string GetTemplate(
       string appkey,
       string blogid,
       string username,
       string password,
       string templateType)
     {
       return (string)Invoke("GetTemplate", new object[]
           {appkey, blogid, username, password, templateType});
     }

     [XmlRpcMethod("blogger.setTemplate")]
     public string SetTemplate(
       string appkey,
       string blogid,
       string username,
       string password,
       string template,
       string templateType)
     {
       return (string)Invoke("SetTemplate", new object[]
           {appkey, blogid, username, password,
            template, templateType});
     }

     [XmlRpcMethod("blogger.getRecentPosts")]
     public RecentPost[] GetRecentPosts(
       string appkey,
       string blogid,
       string username,
       string password,
       int numberOfPosts)
     {
       return (RecentPost[])Invoke("GetRecentPosts", new object[]
           {appkey, blogid, username, password, numberOfPosts});
     }
   }
}

#15 From: "charlescookuk" <charlescook@...>
Date: Tue Apr 16, 2002 6:55 am
Subject: Using the RealProxy Class
charlescookuk
Offline Offline
Send Email Send Email
 
I've been experimenting with the idea of using the .NET framework
class RealProxy to automatically generate a proxy which implements
the required interface.

To implement an XmlRpc client two tasks would be required:

(1) Define an interface representing the methods exposed by the
server endpoint. For example:

interface IStateName
{
   string GetStateName(int StateNumber);
}

(2) Create an instance of the interface:

XmlRpcClientProtocol cp = new XmlRpcClientProtocol();
IStateName isn = (IStateName)cp.CreateProxy(typeof(IStateName));

This saves having to implement the methods (i.e. calling Invoke for
each method) and feels better because it emphasises the abstract
definition of the interaction with the server.

This is the sample code I've used to investigate this idea. The
intermediate class derived from SmartProxy is required because we can
only use single inheritance (the actual XmlRpcClientProtocol class
already derives from WebClientProtocol).

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;

interface IStateName
{
   string GetStateName(int StateNumber);
}

class XmlRpcClientProtocol
{
   public object CreateProxy(Type t)
   {
     XmlRpcRealProxy rp = new XmlRpcRealProxy(this, t);
     return rp.GetTransparentProxy();
   }

   public object Invoke(string method, object[] args)
   {
     if (method == "GetStateName")
     {
       int stateNumber = (int) args[0];
       return String.Format("StateName_{0}", stateNumber);
     }
     throw new Exception("unsupported method");
   }
}

class XmlRpcRealProxy : RealProxy
{
   public XmlRpcRealProxy (XmlRpcClientProtocol cp, Type t)
     : base (t)
   {
     clientProtocol = cp;
   }

   public override IMessage Invoke (IMessage msg)
   {
     IMethodCallMessage mcm = (IMethodCallMessage) msg;
     object retObj = clientProtocol.Invoke(mcm.MethodName, mcm.InArgs);
     IMethodReturnMessage mr
       = new ReturnMessage (retObj, null, 0, null, mcm);
     return mr;
   }

   XmlRpcClientProtocol clientProtocol;
}

class _
{
   static void Main ()
   {
     XmlRpcClientProtocol cp = new XmlRpcClientProtocol();
     IStateName isn = (IStateName)cp.CreateProxy(typeof(IStateName));
     Console.WriteLine (isn.GetStateName(1));
   }
}

#14 From: "charlescookuk" <charlescook@...>
Date: Thu Apr 11, 2002 8:38 pm
Subject: Sample Code - XmlRpcSerializer
charlescookuk
Offline Offline
Send Email Send Email
 
This sample illustrates how the XmlRpcSerializer class can be used to
serialize and deserialize XML-RPC requests and responses between
instance of the XmlRpcRequest/XmlRpcResponse classes and XML
documents in streams. The output from this sample program is included
below.

using System;
using System.IO;
using CookComputing.XmlRpc;

class App
{
   static void Main(string[] args)
   {
     XmlRpcSerializer slr = new XmlRpcSerializer();
     // package parameters to call as object array
     object[] parms = new object[] { 1234 };
     // stream to contain the serialized request
     Stream reqStm = new MemoryStream();
     // create a request - method name and parameters
     XmlRpcRequest req1 = new XmlRpcRequest("echo", parms);
     // serialize request to the stream
     slr.SerializeRequest(reqStm, req1);
     Console.WriteLine("Request XML document is:");
     DumpStream(reqStm);

     // deserialize back to a request - don't pass class type
     // for mapping structs and arrays more accurately
     reqStm.Position = 0;
     XmlRpcRequest req2 = slr.DeserializeRequest(reqStm, null);
     Console.WriteLine("Request contains: {0} {1}",
       req2.args[0].GetType(), req2.args[0]);

     // return value is always a single object
     object retValue = "1234";
     // stream to contain the serialized request
     Stream respStm = new MemoryStream();
     // create a request - just the return value
     XmlRpcResponse resp1 = new XmlRpcResponse(retValue);
     // serialize response to the stream
     slr.SerializeResponse(respStm, resp1);
     Console.WriteLine("Response XML document is:");
     DumpStream(respStm);

     // deserialize back to a response - don't pass class type
     // for mapping structs and arrays more accurately
     respStm.Position = 0;
     XmlRpcResponse resp2 = slr.DeserializeResponse(respStm, null);
     Console.WriteLine("Response contains: {0} {1}",
       resp2.retVal.GetType(), resp2.retVal);
   }

   static void DumpStream(Stream stm)
   {
     stm.Position = 0;
     StreamReader srdr = new StreamReader(stm);
     string s = srdr.ReadLine();
     while (s != null)
     {
       Console.WriteLine(s);
       s = srdr.ReadLine();
     }
   }
}


Request XML document is:
<?xml version="1.0" encoding="utf-8"?>
<methodCall>
   <methodName>echo</methodName>
   <params>
     <param>
       <value>
         <i4>1234</i4>
       </value>
     </param>
   </params>
</methodCall>
Request contains: System.Int32 1234
Response XML document is:
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
   <params>
     <param>
       <value>
         <string>1234</string>
       </value>
     </param>
   </params>
</methodResponse>
Response contains: System.String 1234

#13 From: "charlescookuk" <charlescook@...>
Date: Sat Apr 6, 2002 8:31 pm
Subject: 0.4.3 Available
charlescookuk
Offline Offline
Send Email Send Email
 
Version 0.4.3 of XML-RPC.NET is now available. Its an interim release
with a few bug fixes, mainly in the serialization/deserialization
code.

http://www.cookcomputing.com/xmlrpc/index.html

#12 From: "Bill Kearney" <wkearney99@...>
Date: Sat Apr 6, 2002 4:16 pm
Subject: Re: RSS for this group (was: Change to Group Policy)
wkearney99
Offline Offline
Send Email Send Email
 
> > http://groups.yahoo.com/group/XMLRPCNET/messages?rss=1&amp;viscount=15
> > This and 7000 other RSS feeds can be found at http://www.syndic8.com
> > There's an XML-RPC interface into it as well.

That's excellent, thanks! That RSS file is now in the database:
http://www.syndic8.com/feedinfo.php?FeedID=7263

I've been doing quite a bit of XML-RPC work on Syndic8.  It's providing a pretty
convenient way to keep the database updated with info.  Lately I've been pushing
geographic data into it via xml-rpc calls.  It's not as efficient as, say, bulk
updates, but it's a lot more convenient.

If anyone's interested in doing .Net integration with it let me know. I'd be
interested in talking about it.

-Bill Kearney

#11 From: "charlescookuk" <charlescook@...>
Date: Sat Apr 6, 2002 10:30 am
Subject: Re: RSS for this group (was: Change to Group Policy)
charlescookuk
Offline Offline
Send Email Send Email
 
Done.

--- In XMLRPCNET@y..., "Bill Kearney" <wkearney99@h...> wrote:
...
> You need to make one more change.  The archives must be readable by
everyone,
> not just members.
>
> Once that change is made the RSS file for the group will be
readable via this
> URL:
> http://groups.yahoo.com/group/XMLRPCNET/messages?
rss=1&amp;viscount=15
>
> This and 7000 other RSS feeds can be found at http://www.syndic8.com
>
> There's an XML-RPC interface into it as well.
>
> -Bill Kearney

#10 From: "Jevon MacDonald" <jevon@...>
Date: Fri Apr 5, 2002 5:14 pm
Subject: RE: Re: XmlRpcStruct into my own Struct
jevonmac
Offline Offline
Send Email Send Email
 
Sounds great!, I am looking forward to the release. If you would like me
to test it beforehand, I can do that. But it seems like you have it
wrapped up.



I appreciate your work on this project, it's allowed me to experiment
with .NET in a context which I enjoy.



-          Jevon

-



-----Original Message-----
From: charlescookuk [mailto:charlescook@...]
Sent: Friday, April 05, 2002 12:57 PM
To: XMLRPCNET@yahoogroups.com
Subject: [XMLRPCNET] Re: XmlRpcStruct into my own Struct



I just checked the diffs for the deserialization code and spotted a
change I made following the last release (the RTM version of .NET
requires a change in the code that gets the Type object from the name
of a type). I'll put out a release tomorrow with this fix tomorrow.

- Charles

--- In XMLRPCNET@y..., "Jevon MacDonald" <jevon@m...> wrote:
>
>
> I should have been more clear and said that I had gone the route as
> well.
>




[Non-text portions of this message have been removed]

#9 From: "Bill Kearney" <wkearney99@...>
Date: Fri Apr 5, 2002 5:02 pm
Subject: RSS for this group (was: Change to Group Policy)
wkearney99
Offline Offline
Send Email Send Email
 
> At Bill Kearney's suggestion I am changing the policy of the group to
> allow anyone to post and view the items. This allows the group to be
> read in RSS format. I have also changed the moderation policy to be
> unmoderated but moderated for new members, i.e. when someone joins
> the groups their postings have to be moderated until I change their
> individual setting to unmoderated. This is intended to catch spam
> merchants.

You need to make one more change.  The archives must be readable by everyone,
not just members.

Once that change is made the RSS file for the group will be readable via this
URL:
http://groups.yahoo.com/group/XMLRPCNET/messages?rss=1&amp;viscount=15

This and 7000 other RSS feeds can be found at http://www.syndic8.com

There's an XML-RPC interface into it as well.

-Bill Kearney

#8 From: "charlescookuk" <charlescook@...>
Date: Fri Apr 5, 2002 4:56 pm
Subject: Re: XmlRpcStruct into my own Struct
charlescookuk
Offline Offline
Send Email Send Email
 
I just checked the diffs for the deserialization code and spotted a
change I made following the last release (the RTM version of .NET
requires a change in the code that gets the Type object from the name
of a type). I'll put out a release tomorrow with this fix tomorrow.

- Charles

--- In XMLRPCNET@y..., "Jevon MacDonald" <jevon@m...> wrote:
>
>
> I should have been more clear and said that I had gone the route as
> well.
>

#7 From: "Jevon MacDonald" <jevon@...>
Date: Fri Apr 5, 2002 1:10 pm
Subject: RE: XmlRpcStruct into my own Struct
jevonmac
Offline Offline
Send Email Send Email
 
I should have been more clear and said that I had gone the route as
well.



Whenever I try to return a blogStruct[] (with the blogStruct 's elements
triple checked against what is being returned), I get an error that says
"Object cannot be stored in array of this type."





-----Original Message-----
From: charlescook@... [mailto:charlescook@...]
Sent: Friday, April 05, 2002 8:27 AM
To: XMLRPCNET@yahoogroups.com
Subject: Re: [XMLRPCNET] XmlRpcStruct into my own Struct



Your GetUsersBlogs function should return an
array of blogStruct:

[XmlRpcMethod("blogger.getUsersBlogs")]
public blogStruct[] GetUsersBlogs()
{
...
}

This works because as long as the members in
blogStruct have the same names and compatible
types as the members in the struct in the
response, XML-RPC.NET can automatically map
values between the two (I think this is the case
with this method). In the next release or two I'm
adding an optional attribute which allows you to
define a different mapping, for example:

[XmlRpcMethod("blogger.getUsersBlogs")]
public blogStruct[] GetUsersBlogs()
{
   [XmlRpcMember("isAdmin")
   public bool m_bAdmin;
   ...
}

This would be necessary, for example, if the XML-
RPC struct member name was not CLS-compliant.

XmlRpcStruct has to be used where some of the
members are not necessarily returned in the
response or where you want to pass structs
without a fixed set of members (as in the Web Bug
Simulator example). Conversely, where a response
returns a struct with members not defined in
the .NET struct, XML-RPC.NET will simply ignore
these members; useful if an API is extended by
adding struct members, as in this case where the
isAdmin member has been added to the struct
returned by getUsersBlogs.

A couple of other points. First, from the point
of view of the proxy code you don't need to
define the constructor in blogStruct (of course,
you may need this for other reasons). Second, my
personal approach to proxy code is to keep the
parameters as close as possible to the XML-RPC
method parameters and not use variables from a
scope outside the proxy function. Makes the proxy
code more reusable I suppose.

- Charles

Quoting jevonmac <jevon@...>:

> Hello everyone;
>
> I am playing with the blogger API (an XML-RPC
service).
>
> I can take an Array of XmlRpcStruct properly,
but I would like to
> access the XmlRpcStruct like this
>
> XmlRpcStruct[1].keyInStruct
>
>
> How is this possible?
>
> I currently have
>
> public struct blogStruct
>       {
>             public bool isAdmin;
>             public int blogid;
>             public string blogName;
>             public string url;
>
>             public blogStruct(bool isAdmin,
int blogid, string
> blogName, string url)
>             {
>                   this.isAdmin = isAdmin;
>                   this.blogid = blogid;
>                   this.blogName = blogName;
>                   this.url = url;
>             }
>       }
>
> [... and ...]
>
>             [XmlRpcMethod
("blogger.getUsersBlogs")]
>             public XmlRpcStruct[]
GetUsersBlogs()
>             {
>                   return (XmlRpcStruct[])
this.Invoke
> ("GetUsersBlogs", new object[] {"appkey",
> bIntUser.bloggerUsername ,
bIntUser.bloggerPassword});
>             }
>

-------------------------------------------------
This mail sent through UK Online webmail





Yahoo! Groups Sponsor



ADVERTISEMENT

<http://rd.yahoo.com/M=215002.1954253.3462811.1261774/D=egroupweb/S=1707
281942:HM/A=1000239/R=0/*http:/ads.x10.com/?bHlhaG9vaG0xLmRhd=1018009640
%3eM=215002.1954253.3462811.1261774/D=egroupweb/S=1707281942:HM/A=100023
9/R=1>



<http://us.adserver.yahoo.com/l?M=215002.1954253.3462811.1261774/D=egrou
pmail/S=1707281942:HM/A=1000239/rand=603719726>


To unsubscribe from this group, send an email to:
XMLRPCNET-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/>  Terms of Service.



[Non-text portions of this message have been removed]

#6 From: "charlescookuk" <charlescook@...>
Date: Fri Apr 5, 2002 12:42 pm
Subject: Change to Group Policy
charlescookuk
Offline Offline
Send Email Send Email
 
At Bill Kearney's suggestion I am changing the policy of the group to
allow anyone to post and view the items. This allows the group to be
read in RSS format. I have also changed the moderation policy to be
unmoderated but moderated for new members, i.e. when someone joins
the groups their postings have to be moderated until I change their
individual setting to unmoderated. This is intended to catch spam
merchants.

- Charles

#5 From: charlescook@...
Date: Fri Apr 5, 2002 12:31 pm
Subject: Re: XmlRpcStruct into my own Struct
charlescookuk
Offline Offline
Send Email Send Email
 
Just noticed some cut&paste that went haywire.
The example code for XmlRpcMember attribute
should have been:

public blogStruct
{
   [XmlRpcMember("isAdmin")]
   public bool m_bAdmin;
   ...
}

- Charles



-------------------------------------------------
This mail sent through UK Online webmail

#4 From: charlescook@...
Date: Fri Apr 5, 2002 12:27 pm
Subject: Re: XmlRpcStruct into my own Struct
charlescookuk
Offline Offline
Send Email Send Email
 
Your GetUsersBlogs function should return an
array of blogStruct:

[XmlRpcMethod("blogger.getUsersBlogs")]
public blogStruct[] GetUsersBlogs()
{
...
}

This works because as long as the members in
blogStruct have the same names and compatible
types as the members in the struct in the
response, XML-RPC.NET can automatically map
values between the two (I think this is the case
with this method). In the next release or two I'm
adding an optional attribute which allows you to
define a different mapping, for example:

[XmlRpcMethod("blogger.getUsersBlogs")]
public blogStruct[] GetUsersBlogs()
{
   [XmlRpcMember("isAdmin")
   public bool m_bAdmin;
   ...
}

This would be necessary, for example, if the XML-
RPC struct member name was not CLS-compliant.

XmlRpcStruct has to be used where some of the
members are not necessarily returned in the
response or where you want to pass structs
without a fixed set of members (as in the Web Bug
Simulator example). Conversely, where a response
returns a struct with members not defined in
the .NET struct, XML-RPC.NET will simply ignore
these members; useful if an API is extended by
adding struct members, as in this case where the
isAdmin member has been added to the struct
returned by getUsersBlogs.

A couple of other points. First, from the point
of view of the proxy code you don't need to
define the constructor in blogStruct (of course,
you may need this for other reasons). Second, my
personal approach to proxy code is to keep the
parameters as close as possible to the XML-RPC
method parameters and not use variables from a
scope outside the proxy function. Makes the proxy
code more reusable I suppose.

- Charles

Quoting jevonmac <jevon@...>:

> Hello everyone;
>
> I am playing with the blogger API (an XML-RPC
service).
>
> I can take an Array of XmlRpcStruct properly,
but I would like to
> access the XmlRpcStruct like this
>
> XmlRpcStruct[1].keyInStruct
>
>
> How is this possible?
>
> I currently have
>
> public struct blogStruct
>  {
> 	 public bool isAdmin;
> 	 public int blogid;
> 	 public string blogName;
> 	 public string url;
>
> 	 public blogStruct(bool isAdmin,
int blogid, string
> blogName, string url)
> 	 {
> 		 this.isAdmin = isAdmin;
> 		 this.blogid = blogid;
> 		 this.blogName = blogName;
> 		 this.url = url;
> 	 }
>  }
>
> [... and ...]
>
> 	 [XmlRpcMethod
("blogger.getUsersBlogs")]
> 	 public XmlRpcStruct[]
GetUsersBlogs()
> 	 {
> 		 return (XmlRpcStruct[])
this.Invoke
> ("GetUsersBlogs", new object[] {"appkey",
> bIntUser.bloggerUsername ,
bIntUser.bloggerPassword});
> 	 }
>

-------------------------------------------------
This mail sent through UK Online webmail

#3 From: "jevonmac" <jevon@...>
Date: Thu Apr 4, 2002 8:02 pm
Subject: XmlRpcStruct into my own Struct
jevonmac
Offline Offline
Send Email Send Email
 
Hello everyone;

I am playing with the blogger API (an XML-RPC service).

I can take an Array of XmlRpcStruct properly, but I would like to
access the XmlRpcStruct like this

XmlRpcStruct[1].keyInStruct


How is this possible?

I currently have

public struct blogStruct
	 {
		 public bool isAdmin;
		 public int blogid;
		 public string blogName;
		 public string url;

		 public blogStruct(bool isAdmin, int blogid, string
blogName, string url)
		 {
			 this.isAdmin = isAdmin;
			 this.blogid = blogid;
			 this.blogName = blogName;
			 this.url = url;
		 }
	 }

[... and ...]

		 [XmlRpcMethod("blogger.getUsersBlogs")]
		 public XmlRpcStruct[] GetUsersBlogs()
		 {
			 return (XmlRpcStruct[]) this.Invoke
("GetUsersBlogs", new object[] {"appkey",
bIntUser.bloggerUsername ,  bIntUser.bloggerPassword});
		 }

#2 From: "charlescookuk" <charlescook@...>
Date: Thu Apr 4, 2002 9:46 am
Subject: Sample Code - Web Bug Simulator
charlescookuk
Offline Offline
Send Email Send Email
 
First of a series of samples based on some of the publicly used XML-
RPC APIs.

Technical background to the Web Bug Simulator described at:
http://www.xmlrpc.com/howTheWebBugSimulatorWorks

////////////////
// proxy Code
////////////////

using System;
using CookComputing.XmlRpc;

[XmlRpcUrl("http://subhonker6.userland.com/RPC2")]
class WebBugSimProxy : XmlRpcClientProtocol
{
   [XmlRpcMethod("weblogStats.ping")]
   public bool Ping(
     string rss,
     string title,
     string url,
     XmlRpcStruct theStruct)
   {
     return (bool)Invoke("Ping",
                    new object[] {rss, title, url, theStruct});
   }
}

struct Feed
{
   public int ctnewstories;
   public string title;

   public Feed(int CtNewStories, string Title)
   {
     ctnewstories = CtNewStories;
     title = Title;
   }
}


////////////////
// sample client
////////////////

class App
{
   [STAThread]
   static void Main(string[] args)
   {
     XmlRpcStruct feeds = new XmlRpcStruct();
     feeds.Add("http://radio.weblogs.com/0001015/rss.xml",
               new Feed(1, "Dave's Handsome Radio Blog!"));
     feeds.Add("http://www.pocketsoap.com/weblog/rss.xml",
               new Feed(1, "Simon Fell"));
     WebBugSimProxy proxy = new WebBugSimProxy();
     bool result = proxy.Ping("rss",
                              "Cook Computing",
                              @"http://www.cookcomputing.com/",
                              feeds);
     Console.WriteLine("Result = {0}", result);
   }
}

#1 From: "charlescookuk" <charlescook@...>
Date: Wed Apr 3, 2002 8:42 am
Subject: Welcome
charlescookuk
Offline Offline
Send Email Send Email
 
Welcome to XML-RPC.NET.

Messages 1 - 31 of 1226   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help