What is aXMLRPC?
================
aXMLRPC is a Java library with a leightweight XML-RPC client. XML-RPC is
a specification for making remote procedure calls over the HTTP protocol
in an XML format. The specificationc an be found under http://www.xmlrpc.com/spec.
The library was developed for the use with Android. Since it has no dependencies to
any Android library or any other 3rd-party library, it is fully functional in any
common java virtual machine (not only on Android).
You can control the client with some flags to extend its functionality. See the section
about flags.
How to include it?
==================
How to include the aXMLRPC client into your project?
There are four different ways to do that:
### Include the source code
You can just include all the source code from the `src` directory into the sourcecode
of your project. If you use git yourself, you can use submodules to include the code
as a module to yours. So you will always stay up to date with the library.
### Compile it as library
The library itself is a NetBeans project and can be compiled either with NetBeans or
with `ant`. The resulting JAR file can be used as a dependency in your project. If you
use NetBeans you can make a dependency directly to the project.
### Use Maven
The library is also a valid Maven project. So you can use Maven to compile it.
If you want to use it as a Maven project in NetBeans, you will have to delete
the `nbproject` folder. Afterwards NetBeans will detect it as a Maven project (NetBeans
restart required).
To use it on your Maven project, add it as a dependency on your pom.xml file:
```xml
<dependency>
<groupId>de.timroes</groupId>
<artifactId>aXMLRPC</artifactId>
<version>X.Y.Z</version>
</dependency>
```
where X.Y.Z is the current aXMLRPC version and install it on your local Maven
repository (since it's not available on the Maven repositories):
```console
$ cd /path/to/aXMLRPC/
$ mvn clean install
```
### Download the JAR library
You can download a compiled jar file from the below list and use it as a library
for your project.
[aXMLRPC v1.4.0](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.4.0.jar)
* Added FLAGS_IGNORE_NAMESPACE, FLAGS_DEFAULT_TYPE_STRING
[aXMLRPC v1.3.5](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.3.5.jar)
* Fixed bug in canceling async calls
[aXMLRPC v1.3.4](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.3.4.jar)
* Added getURL-method
* Added FLAGS_IGNORE_SSL_ERRORS
* Removed debugging information from JAR
[aXMLRPC v1.3.3](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.3.3.jar)
* Improved handling of 40X http errors
[aXMLRPC v1.3.2](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.3.2.jar)
* Fixed handling of 40x http errors
[aXMLRPC v1.3.1](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.3.1.jar)
* Fixed bug in XML struct creation
* Method to clear HTTP basic auth login data
[aXMLRPC v1.3.0](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.3.0.jar)
* Flags to ignore SSL warnings
* HTTP forwarding
* Improved code quality
**Real old versions:**
* [aXMLRPC v1.2.0](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.2.0.jar)
* [aXMLRPC v1.1.0](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.1.0.jar)
* [aXMLRPC v1.0.3](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.0.3.jar)
* [aXMLRPC v1.0.2](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.0.2.jar)
* [aXMLRPC v1.0.1](https://dl.dropbox.com/u/56970236/aXMLRPC/aXMLRPC_v1.0.1.jar)
How to use the library?
=======================
You can use the library by initiating an `XMLRPCClient` and make calls over it:
```java
try {
XMLRPCClient client = new XMLRPCClient(new URL("http://example.com/xmlrpc"));
Boolean b = (Boolean)client.call("isServerOk");
Integer i = (Integer)client.call("add", 5, 10);
} catch(XMLRPCServerException ex) {
// The server throw an error.
} catch(XMLRPCException ex) {
// An error occured in the client.
} catch(Exception ex) {
// Any other exception
}
```
Instead of passing the parameters as seperated values, you can also pack them in
an array and pass the array to the method, like in the following example:
```java
// ... The try-catch has been ommited for clarity.
XMLRPCClient client = new XMLRPCClient(url, "MyUserAgentString");
client.call("someMethod", new Object[]{ o1, o2, o3 });
// ...
```
#### Asynchronous Calls
The above method calls are synchronous. So the method `call` will return when the server responded
or an error occured. There is also a possibility for asynchronous server calls.
You need to implement an XMLRPCCallback that will get noticed about the respone (or error) from
the server. The `callAsync` method can be used to make asynchronous calls. It returns an identifier
that will also be send to the XMLRPCCallback instance with the response of the server, so your
application can make multiple calls concurrently and use one listener for them, that distinguish
between the different request by their ids.
```java
XMLRPCCallback listener = new XMLRPCCallback() {
public void onResponse(long id, Object result) {
// Handling the servers response
}
public void onError(long id, XMLRPCException error) {
// Handling any error in the library
}
public void onServerError(long id, XMLRPCServerException error) {
// Handling an error response from the server
}
};
XMLRPCClient client = new XMLRPCClient(url);
long id = client.callAsync(listener, "add", 5, 10);
```
You will be also able to cancel an asynchonous call. Just use the `cancel` method on the `XMLRPCClient` instance,
like in the following example. The listener will not be notified, if the call is canceled.
```java
XMLRPCClient client = new XMLRPCClient(url);
long id = client.callAsync(listener, "method", params);
// ...
client.cancel(id);
```
The data types
--------------
The specification give some data tags for the server response. If you want to work on the
type you must cast the returning `Object` from the `call` method to its specific type.
Which type to cast which XML server response, tells the following list:
`i4`,`int` => `Integer`
`boolean` => `Boolean`
`string` => `String`
`double` => `Double`
`dateTime.iso8601` => `Date`
`base64` => `byte[]` (`Byte[]` won't work)
`array` => `Object[]`
`struct` => `Map<String,Object>`
`i8` => `Long` (see Flags)
Flags
-----
The client takes as second parameter (or third if an user agent is given)
a combination of multiple flags. It could work like the following example:
```java
// ...
XMLRPCClient client = new XMLRPCClient(url,
XMLRPCClient.FLAGS_STRICT | XMLRPCClient.FLAGS_8BYTE_INT);
// ...
```
The following flags are implemented:
#### FLAGS_STRICT
The client should parse responses strict to specification.
It will check if the given content-type is right.
The method name in a call must only contain of A-Z, a-z, 0-9, _, ., :, /
Normally this is not needed.
#### FLAGS_8BYTE_INT
The client will be able to handle 8 byte integer values (longs).
The xml type tag `<i8>` will be used. This is not in the specification
but some libraries and servers support this behaviour.
If this isn't enabled you cannot recieve 8 byte integers and if you try to
send a long, the value must be within the 4 byte integer range.
#### FLAGS_ENABLE_COOKIES
With this flag, the client will be able to handle cookies, meaning saving cookies
from the server and sending it with every other request again. This is needed
for some XML-RPC interfaces that support login.
#### FLAGS_NIL
The client will be able to send `null` values. A `null` value will be send
as `<nil/>`. This extension is described under: http://ontosys.com/xml-rpc/extensions.php
#### FLAGS_IGNORE_STATUSCODE
With this flag enabled, the XML-RPC client will ignore the HTTP status
code of the response from the server. According to specification the
status code must be 200. This flag is only needed for the use with
not standard compliant servers
没有合适的资源?快使用搜索试试~ 我知道了~
linphone编译源码
共1597个文件
class:584个
png:392个
java:227个
4星 · 超过85%的资源 需积分: 10 12 下载量 182 浏览量
2017-03-24
11:04:44
上传
评论
收藏 13.55MB RAR 举报
温馨提示
android linphone编译源码
资源推荐
资源详情
资源评论
收起资源包目录
linphone编译源码 (1597个子文件)
configure.ac 2KB
IInAppBillingService.aidl 8KB
IInAppBillingService.aidl 8KB
IInAppBillingService.aidl 8KB
Makefile.am 6KB
Makefile.am 3KB
Makefile.am 812B
Makefile.am 535B
AUTHORS 0B
linphonecore.c 266KB
linphonecall.c 199KB
misc.c 71KB
presence.c 68KB
proxy.c 66KB
callbacks.c 52KB
sal_impl.c 47KB
friend.c 46KB
chat.c 44KB
upnp.c 43KB
sal_op_call.c 41KB
sal_sdp.c 40KB
sal.c 36KB
quality_reporting.c 35KB
lime.c 33KB
friendlist.c 31KB
lpconfig.c 30KB
carddav.c 29KB
sal_op_impl.c 28KB
chat_file_transfer.c 27KB
ldapprovider.c 25KB
offeranswer.c 25KB
message_storage.c 23KB
call_log.c 21KB
account_creator.c 18KB
sal_op_presence.c 17KB
sal_op_events.c 16KB
event.c 15KB
sal_op_message.c 15KB
xmlrpc.c 14KB
authentication.c 13KB
sqlite3_bctbx_vfs.c 13KB
call_params.c 13KB
vtables.c 12KB
nat_policy.c 11KB
lpc2xml.c 11KB
ec-calibrator.c 11KB
xml2lpc.c 11KB
sal_op_call_transfer.c 11KB
lsd.c 9KB
sal_address_impl.c 9KB
content.c 8KB
lookup.c 8KB
address.c 8KB
buddy_status.c 7KB
filetransfer.c 7KB
sipsetup.c 6KB
player.c 6KB
remote_provisioning.c 6KB
notify.c 6KB
sal_op_registration.c 5KB
registration.c 5KB
sal_op_publish.c 5KB
info.c 4KB
realtimetext_sender.c 4KB
dict.c 4KB
xml.c 4KB
contactprovider.c 4KB
enum.c 4KB
vcard_stubs.c 4KB
localplayer.c 4KB
ringtoneplayer.c 4KB
realtimetext_receiver.c 3KB
linphone_tunnel_config.c 3KB
helloworld.c 3KB
siplogin.c 3KB
linphone_tunnel_stubs.c 3KB
buffer.c 3KB
fonis.c 3KB
chatroom.c 3KB
sal_op_info.c 1KB
linphonecore_jni.cc 296KB
conference.cc 31KB
TunnelManager.cc 14KB
linphone_tunnel.cc 13KB
vcard.cc 11KB
ChangeLog 0B
LinphoneManager.class 52KB
LinphoneCoreImpl.class 52KB
LinphoneActivity.class 44KB
CallActivity.class 42KB
LinphonePreferences.class 33KB
ChatFragment.class 26KB
SettingsFragment.class 24KB
R$string.class 21KB
LinphoneService.class 21KB
SlidingDrawer.class 20KB
AssistantActivity.class 19KB
LinphoneContact.class 19KB
LinphoneUtils.class 17KB
ContactEditorFragment.class 16KB
共 1597 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
- 企鹅啊但是我2019-02-20还不错了 A
lichao3140
- 粉丝: 11
- 资源: 65
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功