The sayHello method is a test
<http://www.javaranch.com/unit-testing.jsp> method
that returns a string "hello". it does,nt requires an authentication.

On Sun, Sep 19, 2010 at 10:58 PM, prasath nadarajah <n.prasath....@gmail.com
> wrote:

> Hi,
> i,m developing an weblog client application using 
> java<http://www.javaranch.com/> and
> apache xmlrpc libraries.
> I wrote a simple program i used to communicate with WordPress.
> but it throws the following exception:
>
> Exception: Failed to parse server's response: Expected methodResponse
> element, got html
>
> I cannot figure out what's wrong with the code
> can anyone help me on this??
>
> *Program*
>
> import org.apache.xmlrpc.client.XmlRpcClient;
> import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
> import 
> java.net.URL<http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/net/URL.html>
> ;
> import 
> java.util.Vector<http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/Vector.html>
> ;
>
> public class SimpleXmlrpc {
>
> public SimpleXmlrpc() {
> }
>
> public static void 
> main(String<http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBuilder-Performance>[]
> args) {
>
> XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
>
> try{
>
> config.setServerURL(new URL("http://localhost/wordsite";));
> XmlRpcClient client = new XmlRpcClient();
> client.setConfig(config);
>
> Object[] params = new Object[]{ new String("usrername"),
> new String("password")
> };
>
> String result = (String)client.execute("sayHello", params); .
> System.out.println("Results" + result);
> }
> catch(Exception e)
> {
> System.out.println("Exception: " + e.getMessage());
> }
> }
> }
>
>
>
> http://codex.wordpress.org/XML-RPC_wp

Reply via email to