B4A Library XMLRPC Library

Hello,

I created this new library, requested by Phillipp, over here.
It supports some basic functions for XMLRPC.

XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.

XML-RPC works by sending a HTTP request to a server implementing the protocol. The client in that case is typically software wanting to call a single method of a remote system. Multiple input parameters can be passed to the remote method, one return value is returned. The parameter types allow nesting of parameters into maps and lists, thus larger structures can be transported. Therefore XML-RPC can be used to transport objects or structures both as input and as output parameters.

The attachments has three files:
- A Readme file.
- A sample file
- The library files.

Tomas
 

Attachments

  • XMLRPC1.1.zip
    310.4 KB · Views: 928

Philipp

Member
Licensed User
Longtime User
Good Work :sign0098:

You forgot to take the phone permission though. I edited the manifest, but isn't it in the lib?

I'm having trouble testing this with arrays. I'm sure it's not your library but the way the bespoken test-server wants arrays. If I give Java-Arrays (started testing with processing, since I always get an error with b4a) it states that it's the wrong type.

I'm gonna have to give it a break, since my database- and c#-homework needs to be done till tomorrow :(

If you don't come up with an idea I'll investigate further on monday evening when I'm back from evening school.
 

barx

Well-Known Member
Licensed User
Longtime User
I wish to use this to interrogate an Invision Power Board forum. the api documentation for the system gives an example of the following:

B4X:
    <?phpdefine( 'IPS_XML_RPC_DEBUG_ON' , 0 );define( 'IPS_XML_RPC_DEBUG_FILE', '' );// Adjust this path as neededrequire_once( "ips_kernel/classXmlRpc.php" );$classXmlRpc = new classXmlRpc();// Adjust the URL as needed, and supply a valid api_keyprint_r($classXmlRpc->sendXmlRpc( "<url to your board>/interface/board/index.php", "helloBoard", array( 'api_module' => 'ipb', 'api_key' => '<api key>' ) ) );exit;

It passes some parameters using a php array. How would these be done with this lib? map(s)? one map per key/value?

any tips your be great.

Thanks
 

xalion

Member
Licensed User
Longtime User
Thank you.

but I can't compiler fllow lines:

Dim b() As Byte
b=XMLRPC1.arrayCall("getimg","")

Can you help ?
 

westingenieria

Active Member
Licensed User
Longtime User
The tablet is stuck when i call :

sDataOut = XMLRPC1.stringCall(sService, sDataIn)

it last like 2-6 seconds approx. Anyone have an idea of what happend here?:BangHead:
 

Angel Maza

Member
Licensed User
Longtime User
Hello, it's possible to make methods for more params? or even a variable params method like callEx use?

I'm using directly with reflection library (org.android.XMLRPCClient ) + your library, for avoiding params limits.
I've some exceptions calling callex (About line 224), and I see that the sources aren't fresh as the only cast to integer is about line 350:
int faultCode = (Integer) map.get(Tag.FAULT_CODE);
The exceptions are parsing results related.
Exception:
W/System.err(22212): java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
W/System.err(22212): at org.xmlrpc.android.XMLRPCClient.callEx(XMLRPCClient.java:224)
W/System.err(22212): at org.xmlrpc.android.XMLRPCClient.call(XMLRPCClient.java:371)

Can you also recompile your library with fresh sources XMLRPCClient? I'm new to B4A and I don't know how to include external libraries for using with reflection.

Thanks

Best regards.
Angel.
 

stanks

Active Member
Licensed User
Longtime User
your example doesn't work (throws exception) with default manifest file. i had to remove
B4X:
android:targetSdkVersion="14"
from manifest and example works ok. any idea why?

thanks
 
Top