You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by ThekkayilJoy Thomas <th...@gmail.com> on 2011/10/19 07:09:34 UTC

Getting XmlRpcClientException when using xml rpc 3.1.3 jar

Hi,

      I am trying to login to a nessus server using apache xml rpc 3.1.3 in
java. I am getting XmlRpcClientException. Upon debugging i can find that the
response is coming and even response message is coming as OK but the
response is not getting parsed properly.

It is giving sax parser exception.

Please let me know what i am doing wrong.

Sample:

XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("https://a.b.c.d:8834" ));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);

Object[] params = new Object[] {new
String("login=admin2&seq=1&password=password")};
Object result = client.execute("Login", params);

Output is:
Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException:
Failed to parse server's response: Expected methodResponse element, got html

    at XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:172)

Thanks,
Thomas

Re: Getting XmlRpcClientException when using xml rpc 3.1.3 jar

Posted by Jochen Wiedmann <jo...@gmail.com>.
Doesn't look like a proper response from the Nessus server. Could you
use Wireshark, tcpdump, or a similar tool to trace the conversation
between client and server. This should allow me to be more specific.

Thanks,

Jochen



On Wed, Oct 19, 2011 at 7:09 AM, ThekkayilJoy Thomas
<th...@gmail.com> wrote:
> Hi,
>
>       I am trying to login to a nessus server using apache xml rpc 3.1.3 in
> java. I am getting XmlRpcClientException. Upon debugging i can find that the
> response is coming and even response message is coming as OK but the
> response is not getting parsed properly.
>
> It is giving sax parser exception.
>
> Please let me know what i am doing wrong.
>
> Sample:
>
> XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
> config.setServerURL(new URL("https://a.b.c.d:8834" ));
> XmlRpcClient client = new XmlRpcClient();
> client.setConfig(config);
>
> Object[] params = new Object[] {new
> String("login=admin2&seq=1&password=password")};
> Object result = client.execute("Login", params);
>
> Output is:
> Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException:
> Failed to parse server's response: Expected methodResponse element, got html
>     at XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:172)
>
> Thanks,
> Thomas



-- 
Capitalism is the astounding belief that the most wickedest of men
will do the most wickedest of things for the greatest good of
everyone.

John Maynard Keynes (http://en.wikiquote.org/wiki/Keynes)

https://linuxcounter.net/user/221257.html

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org