Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
bdinesh
Posts: 2
Joined: Sun Jul 12, 2009 2:26 pm

Help required on calling XmlRpc methods

Sun Jul 12, 2009 2:34 pm

Following is the interface I have created:

using System;
using System.Collections.Generic;
using System.Text;
using CookComputing.XmlRpc;

namespace SubtitleFinderLib
{
namespace OpenSubtitles
{
[XmlRpcUrl("http://dev.opensubtitles.org/xml-rpc")]
public interface IOpenSubtitlesXmlRpc : IXmlRpcProxy
{
[XmlRpcMethod("ServerInfo")]
string[] ServerInfo();

[XmlRpcMethod("LogIn")]
string[] LogIn(string UserName, string Password, string Language, string UserAgent);

[XmlRpcMethod("LogOut")]
string LogOut(string Token);
}
}
}

I have created following Proxy class using the above interface:

using System;
using System.Collections.Generic;
using System.Text;
using CookComputing.XmlRpc;

namespace SubtitleFinderLib
{
namespace OpenSubtitles
{
public class OpenSubtitlesProxy
{
private static IOpenSubtitlesXmlRpc OpenSubtitlesService = XmlRpcProxyGen.Create<IOpenSubtitlesXmlRpc>();

public static string[] Login(string UserName, string Password, string Language, string UserAgent)
{
string[] Result;
try
{
Result = OpenSubtitlesService.LogIn(UserName, Password, Language, UserAgent);
}
catch (Exception Ex)
{
throw;
}

return Result;
}

public static string Logout(string Token)
{
return OpenSubtitlesService.LogOut(Token);
}

}
}
}

when i use the Login method of above class I am getting following exception:

response contains struct value where array expected (as type String[]) [response]

can any one please help on this.

User avatar
eduo
Posts: 716
Joined: Sat Feb 10, 2007 1:40 am
Location: Information Technology
Contact: ICQ Website Yahoo Messenger

Tue Jul 14, 2009 1:40 am

It really makes more sense if you share the actual XML being produced and received, rather than your code.

In the API trac there's a detailed api with sample files. Those could help you compare with your output.

The error seems pretty clear, though. And it seems to be in the way you're handling the response, which you didn't include here.
http://eduo.info/
[url=http://eduo.info/soleol/]OpenSubtitles from your desktop: SolEol for Mac/Windows/Linux[/url]
[url=http://forums.plexapp.com/index.php?showtopic=325&st=0&p=2480&#entry2480]My current episode processing work flow[/url].

bdinesh
Posts: 2
Joined: Sun Jul 12, 2009 2:26 pm

Sun Jul 19, 2009 8:39 am

Thanks for the reply, can you please tell how to get the XML, and also can you please provide URL of the API and sample examples.

User avatar
eduo
Posts: 716
Joined: Sat Feb 10, 2007 1:40 am
Location: Information Technology
Contact: ICQ Website Yahoo Messenger

Mon Jul 20, 2009 12:55 am

Thanks for the reply, can you please tell how to get the XML, and also can you please provide URL of the API and sample examples.
What? No.

How are you trying to do this? Not only should you be posting this to the Developer's forum but you should first have read all the amply-documented and freely available information from the Trac site for opensubtitles.

I'm sorry for my first response, I assumed you already had traversed, understood and still found problems with the API. I assumed too much.

trac.opensubtitles.org
http://eduo.info/
[url=http://eduo.info/soleol/]OpenSubtitles from your desktop: SolEol for Mac/Windows/Linux[/url]
[url=http://forums.plexapp.com/index.php?showtopic=325&st=0&p=2480&#entry2480]My current episode processing work flow[/url].

Return to “Programs using OS”

Who is online

Users browsing this forum: No registered users and 23 guests