Writing /home/infogasy/domains/wiki.infogasy.net/public_html/data/cache/a/a98803b40585481dbff044221fa618cb.xhtml failed

Interface XML-RPC eto amin'ny Wiki Infogasy

Fanamarihana : Tsy mitombina intsony izy ity kanefa dia azo ampiasaina ihany raha hanandramana ho an’izay mikasa hampiasa ny jspwiki

Nametraka ny activation ny interface XML-RPC amin’ny Wiki Infogasy ny eto amin’ny sehatra ka nanandrana nanoratra client ohatra azo ampiasaina amin’izany. Ny rohy hitifirana azy (amin’izao aloha) dia ny : http://infogasy.dyndns.org/wiki/RPC2/ . Ohatra amin’ny C# sy Java no ho aseho eto. Atao pieces jointes ery ambany ireo rakitra samihafa.

Ny andrana natao dia mamerina ireo lisitry ny pejy Wiki rehetra .

C# : Framework .Net (Mono) amin'ny Linux

1. Class WikiRPC.cs :

 
using System;
using System.Collections;
using Nwc.XmlRpc;
 
/*
/**
  * @author fraz
  * @date : 20 Mai 2005
  */
 
class WikiRPC
{
    [[STAThread]]
    static void Main()
    {
		const string ALLPAGES = "wiki.getAllPages";
		const string URI = "http://infogasy.dyndns.org/wiki/RPC2/";
		
		XmlRpcResponse response;
 
		XmlRpcRequest client = new XmlRpcRequest();
 
		client.MethodName = ALLPAGES;
 
		ArrayList array = new ArrayList();
 
		response = client.Send(URI);
 
		if (response.IsFault)
		{
			Console.WriteLine(String.Format("Fault {0}: {1}"
                            , response.FaultCode, response.FaultString));
		}
		else
		{
			array = (ArrayList) response.Value;
 
			//Alahatra kely aloha
			array.Sort();
		}
 
		//Isany : Nanaovana andrana fotsiny
		//Console.WriteLine(array.Count.ToString());
		
		foreach (string item in array)
		{
			Console.WriteLine(item);
		}
 
    }
}
 
 

2. Fandefasana azy

Atao ao anaty repertoire iray io code sy ilay librairie xml-rpc (ny an’ i Nicholas Christopher no nampiasaina teto) XmlRpcCS.dll. Tokony hisy fichier roa zany ao WikiRPC.cs sy io XmlRpcCS.dll io

Compilation : Mila efa voapetraka tsara aloha ny Mono vao mandeha ny zavatra atao eto. Raha tsy manana Mono moa mazava ho azy fa afaka atao @ .Net tsotra amin’ny Windows.

shell$ mcs /r:XmlRpcCS.dll WikiRPC.cs

Ny option /r midika hoe atao reference ilay XmlRpcCS.dll.

Execution:

shell$ mono WikiRPC.exe

Valiny azo:

3G
802.11
AdWare
AntiSpyware
......

Java miaraka amin'ny XMl-RPC an'i Apache (org.apache.xmlrpc) helma taloha

1. Class WikiRPC.java :

 
import java.util.Collections;
import java.util.Vector;
import org.apache.xmlrpc.XmlRpcClient;
 
import org.apache.xmlrpc.XmlRpcException;
import java.io.IOException;
 
/*
/**
  * @author fraz
  * @date : 20 Mai 2005
  */
 
public class WikiRPC 
{
 
        private static final String ALLPAGES = "wiki.getAllPages";
	private static final String URI = "http://infogasy.dyndns.org/wiki/RPC2/";
    
 
	public static void main(String[[]] args) throws XmlRpcException, IOException 
	{
	    
		XmlRpcClient xmlrpc = new XmlRpcClient (URI);
 
		Vector list = (Vector) xmlrpc.execute (ALLPAGES,new Vector(0));
 
		// Isany
		//System.out.println(list.size());
 
		//Alahatra kely aloha
		Collections.sort(list);
          
		for (int i = 0; i < list.size(); i++) 
		{
	            String item = (String) list.elementAt(i);
	            System.out.println(item);
		}
	}
}
 

2. Fandefasana azy

Atao ao anaty repertoire iray ilay code WikiRPC.java sy ilay librairie xmlrpc.jar. Ny ahy moa nataoko anaty repertoire lib ilay izy

Compilation :

Tokony efa hisy J2SE koa izany eto aloha (5 no nampiasaina)

Mila ampiana anatin’ny classpath eto ny xmlrpc.jar izay ao anaty lib.

shell$ javac -Xlint:unchecked -cp lib/xmlrpc.jar WikiRPC.java

Ny option Xlint:unchecked dia hialana amin’ireo warning . Fiovana tamin’ny version 5 izy io, mailo izy raha vao misy zavatra tsy mazava ampiasaina, indrindra rehefa manao casting. Ohatra hoe manampy zavatra anaty Collection nefa tsy fantany mazava hoe inona ny type n’ilay zavatra ampiana.

Execution:

shell$ java -cp .:lib/xmlrpc.jar WikiRPC

classpath : Ny dikan’ny . hoe repertoire courant, raha tsy asiana an’io dia tsy hitany ilay classe-nao vao nocompiler-na teo WikiRPC (WikiRPC.class) izany eto. Dia ampiana an’ilay lib/xmlrpc.jar moa mazava ho azy toy ny teo aloha.

Valiny azo:

3G
802.11
AdWare
AntiSpyware
......

Rohy samihafa

  • Package XML-RPC C# (Nicholas Chistopher) : XmlRpc

Samihafa

 

xmlrpcwiki.txt · Novaina farany:: 2008/09/11 12:43