cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Improving Error Handling in the STSClient
Date Mon, 23 Jun 2014 09:55:24 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 45867c50a -> 9c365352a


Improving Error Handling in the STSClient


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9c365352
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9c365352
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9c365352

Branch: refs/heads/master
Commit: 9c365352a26dea7ce0eeb5de23206b96e087821f
Parents: 45867c5
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jun 23 10:37:06 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jun 23 10:37:06 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/ws/security/trust/AbstractSTSClient.java   | 7 +++++--
 .../java/org/apache/cxf/ws/security/trust/Messages.properties | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9c365352/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
index bf32cce..1c97567 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
@@ -568,6 +568,10 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
                         endpointName = services.get(0).getEndpoints().iterator().next().getName();
                         ei = service.getEndpointInfo(endpointName);
                     }
+                    
+                    if (ei == null) {
+                        throw new TrustException(LOG, "ADDRESS_NOT_MATCHED", location);
+                    }
 
                     if (location != null && !anonymousAddress.equals(location)) {
                         ei.setAddress(location);
@@ -576,8 +580,7 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
                     client = new ClientImpl(bus, endpoint);
                 }
             } catch (Exception ex) {
-                //TODO
-                ex.printStackTrace();
+                throw new TrustException(LOG, "WS_MEX_ERROR", ex);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/9c365352/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
index dddcc67..d301c27 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
@@ -25,3 +25,5 @@ DERIVED_KEY_ERROR=Exception while trying to create secret key from RequestSecuri
 ENCRYPTED_KEY_ERROR=Exception while trying to decrypt key from RequestSecurityTokenResponse
 VALIDATION_FAILED=Validation of security token failed: {0}
 NO_USER_PASSWORD=No user name and/or password is available, name: {0}, password: {1}
+ADDRESS_NOT_MATCHED=Cannot match the address {0} to the WSDL received via WS-MEX
+WS_MEX_ERROR=Exception when trying to retrieve/process a WSDL via WS-MEX


Mime
View raw message