Jump to content

Feedback for Mark from support

Featured Replies

Posted

Hi All,

I do not usually post on these forums but thought it worthwhile in this case.

We were having issues using the XML-RPC interface with the IP.Board forum software from a ASP.NET Web application.

I requested online assistance and resolved the problem within an hour.

It turned out that we were using a non-associate array when passing parameters via XML-RPC which meant the server responded with "unable to locate module: ''".

To resolve this Mark instructed me to use a struct which worked - thanks a lot!

For reference (using the xml-rpc.net library from http://xml-rpc.net/):

====================

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

namespace xmlrpc.client
{
/// <summary>
/// Program to allow procedure calls over the Internet using XML-RPC to use non .NET services
/// Uses HTTP transport and XML encoding
/// Guidance available at http://www.wordtracker.com/docs/api/ch03s04.html
/// Author: Benjamin Athawes
/// </summary>
public class Program
{
// Struct required to send associated parameters in XML
public struct ApiVariables
{
public string api_key, api_module;

public ApiVariables(string key, string module)
{
api_key = key;
api_module = module;
}
}

static void Main(string[] args)
{
IWordTracker proxy = (IWordTracker)XmlRpcProxyGen.Create(typeof(IWordTracker));

ApiVariables apiVariables = new ApiVariables("guidexample", "ipb");

XmlRpcStruct result = proxy.helloBoard(apiVariables);

foreach (DictionaryEntry dictionaryEntry in result)
{
Console.WriteLine(dictionaryEntry.Key + " : " + dictionaryEntry.Value);
}
}
}

[XmlRpcUrl("http://example.com/interface/board/index.php")]
public interface IWordTracker
{
[XmlRpcMethod("helloBoard")]
XmlRpcStruct helloBoard(xmlrpc.client.Program.ApiVariables apiVariables);
}
}

:wub:

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.