0

I am trying to send an XMLRPC Request via Java and is unsuccessful. Here's the structure of XMLRPC Request that I need to send with method name create.account:

<createaccount>
<functioncode>bank_account</functioncode> <cardnumber>55553263654898</cardnumber>
<transaction_id>12345678</transaction_id>
<transactiondatetime>2012-01-08 14:12:22</transactiondatetime>
</createaccount>

As per client, I should be expecting the following XMLRPC Response:

<createaccount>
<code>200</code>
<message>SUCCESS</message>
<functioncode>bank_account</functioncode> 
<cardnumber>55553263654898</cardnumber>
<transaction_id>12345678</transaction_id>
<transactiondatetime>2012-01-08 14:12:22</transactiondatetime>
</createaccount>

I have made the following snippet in java but I'm getting an error: 'Failed to create input stream: Server returned HTTP response code: 500 for URL'

Here's the snippet:

    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();

        config.setServerURL(new URL(server_url));
        XmlRpcClient client = new XmlRpcClient();
        config.setBasicUserName(pUser);
        config.setBasicPassword(pPassword);
        client.setConfig(config);

        Map m = new HashMap();
        m.put("functioncode", "bank_account");
        m.put("cardnumber", "55553263654898");
        m.put("transaction_id", "12345678");
        m.put("transactiondatetime", "2012-01-08 14:12:22");

        Object[] params = new Object[]{m};
        String result = (String)client.execute("bank.account", params);
        System.out.println("Results:" + result);

How I can do this?

1
  • Is there anyone there that can help? Commented Feb 8, 2012 at 8:24

1 Answer 1

1

I would recommend using XML-RPC library, for example Redston XML-RPC. More info and tutorial can be found here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.