Skip to content

Commit

Permalink
Made ResponseParser public
Browse files Browse the repository at this point in the history
so that it's now possible to use aXMLRPC with an arbitrary transport.

Should fix #72
  • Loading branch information
gturri committed Jun 16, 2017
1 parent b76c45c commit 13c74d3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Tweaks to make it possible to use an arbitrary transport
Fix potential race condition

1.10.0
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,20 @@ of the server will be ignored.
This will enable the following flags: FLAGS_IGNORE_NAMESPACES, FLAGS_NIL,
FLAGS_DEFAULT_TYPE_STRING

Using an arbitrary transport
============================
aXMLRPC uses http with the java.net API. If you want to use another protocol or API, you can do:

```java
boolean debug = false;
SerializerHandler serializerHandler = new SerializerHandler(); // or you may build it with flags
String payload = new Call(serializerHandler, "add", 5, 10).getXML(debug);

InputStream istream = sendPayloadWithMyTransport(payload); // use your implementation here

Integer i = (Integer) new ResponseParser.parse(serializerHandler, istream, debug);
```


License
=======
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/timroes/axmlrpc/ResponseParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* @author Tim Roes
*/
class ResponseParser {
public class ResponseParser {

private static final String FAULT_CODE = "faultCode";
private static final String FAULT_STRING = "faultString";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public class SerializerHandler {

private int flags;

public SerializerHandler(){
this(XMLRPCClient.FLAGS_DEBUG);
}

public SerializerHandler(int flags) {
this.flags = flags;
string = new StringSerializer(
Expand Down

0 comments on commit 13c74d3

Please # to comment.