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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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
How to extract response data from XmlRpcStruct in C#   Message List  
Reply | Forward Message #1190 of 1226 |

Hi guys,

Could somebody help me extracting the response data from XmlRpcStruct in
xml-rpc webservice method call.

I have a xml-rpc webservice which insert/update users and the response
comes as XmlRpcStruct.

Here is how my code look like:

[XmlRpcMissingMapping(MappingAction.Ignore)]

public struct DrupalUser

{

public string uid;

public string username;

public string email;

public string initials;

public string firstname;

public string lastname;

}

[XmlRpcUrl(http://test.webservice.com/services/xmlrpc
<http://test.webservice.com/services/xmlrpc> )]

public interface IServiceSystem : IXmlRpcProxy

{

[XmlRpcMethod("user.update")]

XmlRpcStruct update(string hash, string dom, string tmstamp, string non,
DrupalUser[] users);

}

static void Main(string[] args)

{

IServiceSystem iss = XmlRpcProxyGen.Create<IServiceSystem>();

XmlRpcStruct upd = new XmlRpcStruct();

// calling webservice

upd = iss.update(hash, dom, tmstamp, non, u_update);

foreach (DictionaryEntry d in upd)

{

Console.WriteLine(d.Key.ToString() + " : " + d.Value.ToString());

}

}

Output:

Successes: System.Object[]

failures: System.Object[]

Expected output in case of success should be:

successes: [

{uid: 42, username: "adf", email: "afaf@...
<mailto:afaf@...> ", firstname: "mr", lastname: "aaba", initials:
"afdfa"},

{uid: 43, username: "another_user", email: "blah@...
<mailto:blah@...> ", firstname: "another", lastname: "user"}

]

failures: []

Expected output in case of failure should be:

failures: [{

record: {username: "adf", email: "afaf@...
<mailto:afaf@...> ", firstname: "mr", lastname: "aaba", initials:
"afdfa"},
errors: {uid: "User already exists!"}


}]

successes: []

Looking forward to hearing from you.

Thanks.

Zeeshan.



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




Fri Jul 10, 2009 9:47 am

zeeshana_2000
Offline Offline
Send Email Send Email

Forward
Message #1190 of 1226 |
Expand Messages Author Sort by Date

Hi guys, Could somebody help me extracting the response data from XmlRpcStruct in xml-rpc webservice method call. I have a xml-rpc webservice which...
Syed Zeeshan Alam
zeeshana_2000
Offline Send Email
Jul 10, 2009
9:51 am

Hi. I'm New in C# and xml-rpc.NET. But it's a good idea use the Try Catch. Here a code, I didn't test, but I think is ok. I removed ToString too. I hope have...
Diego Vargas
cyph3rk
Offline Send Email
Jul 22, 2009
5:49 pm
Advanced

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