Permalink
Browse files

FLAGS_IGNORE_STATUCODE implemented

  • Loading branch information...
timroes committed Dec 11, 2011
1 parent f8815ec commit ce6a7ce0043c2da11cdbafdb597a48b5ab48701f
Showing with 18 additions and 1 deletion.
  1. +8 −0 README.md
  2. +10 −1 src/de/timroes/axmlrpc/XMLRPCClient.java
View
@@ -154,6 +154,14 @@ for some XML-RPC interfaces that support login.
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.
+
License
=======
@@ -83,6 +83,14 @@
*/
public static final int FLAGS_NIL = 0x08;
+ /**
+ * 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.
+ */
+ public static final int FLAGS_IGNORE_STATUSCODE = 0x10;
+
private int flags;
private URL url;
@@ -610,7 +618,8 @@ public Object call(String methodName, Object[] params) throws XMLRPCException {
InputStream istream = http.getInputStream();
- if(http.getResponseCode() != HttpURLConnection.HTTP_OK) {
+ if(!isFlagSet(FLAGS_IGNORE_STATUSCODE)
+ && http.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new XMLRPCException("The status code of the http response must be 200.");
}

0 comments on commit ce6a7ce

Please sign in to comment.