diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java index dc3c2115d0..e92bfa07e4 100644 --- a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java +++ b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java @@ -90,7 +90,9 @@ class AtomBindingInvoker implements Invoker { // Send an HTTP GET GetMethod getMethod = new GetMethod(uri + "/" + id); - getMethod.setRequestHeader("Authorization", authorizationHeader); + if (authorizationHeader != null) { + getMethod.setRequestHeader("Authorization", authorizationHeader); + } boolean parsing = false; try { httpClient.executeMethod(getMethod); @@ -167,7 +169,9 @@ class AtomBindingInvoker implements Invoker { // Send an HTTP POST PostMethod postMethod = new PostMethod(uri); - postMethod.setRequestHeader("Authorization", authorizationHeader); + if (authorizationHeader != null) { + postMethod.setRequestHeader("Authorization", authorizationHeader); + } boolean parsing = false; try { @@ -253,7 +257,9 @@ class AtomBindingInvoker implements Invoker { // Send an HTTP PUT PutMethod putMethod = new PutMethod(uri + "/" + id); - putMethod.setRequestHeader("Authorization", authorizationHeader); + if (authorizationHeader != null) { + putMethod.setRequestHeader("Authorization", authorizationHeader); + } try { @@ -304,7 +310,9 @@ class AtomBindingInvoker implements Invoker { // Send an HTTP DELETE DeleteMethod deleteMethod = new DeleteMethod(uri + "/" + id); - deleteMethod.setRequestHeader("Authorization", authorizationHeader); + if (authorizationHeader != null) { + deleteMethod.setRequestHeader("Authorization", authorizationHeader); + } try { httpClient.executeMethod(deleteMethod); int status = deleteMethod.getStatusCode(); @@ -345,7 +353,9 @@ class AtomBindingInvoker implements Invoker { // Send an HTTP GET GetMethod getMethod = new GetMethod(uri); - getMethod.setRequestHeader("Authorization", authorizationHeader); + if (authorizationHeader != null) { + getMethod.setRequestHeader("Authorization", authorizationHeader); + } boolean parsing = false; try { httpClient.executeMethod(getMethod); @@ -421,7 +431,9 @@ class AtomBindingInvoker implements Invoker { // Send an HTTP GET GetMethod getMethod = new GetMethod(uri); - getMethod.setRequestHeader("Authorization", authorizationHeader); + if (authorizationHeader != null) { + getMethod.setRequestHeader("Authorization", authorizationHeader); + } getMethod.setQueryString(queryString); boolean parsing = false; try { |