You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2014/06/26 14:48:41 UTC
[2/2] git commit: Avoiding NPE if either a location/wsdlLocation is
not configured on the STSClient
Avoiding NPE if either a location/wsdlLocation is not configured on the STSClient
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/68372daf
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/68372daf
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/68372daf
Branch: refs/heads/master
Commit: 68372daf6074e38d9297bb69a7810c51a70bae3e
Parents: 403a4fb
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Jun 26 11:10:49 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Thu Jun 26 13:48:34 2014 +0100
----------------------------------------------------------------------
.../java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java | 4 +++-
.../java/org/apache/cxf/ws/security/trust/Messages.properties | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/68372daf/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 65c028e..0812928 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
@@ -638,11 +638,13 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
EndpointInfo ei = service.getEndpointInfo(endpointName);
Endpoint endpoint = new EndpointImpl(bus, service, ei);
client = new ClientImpl(bus, endpoint);
- } else {
+ } else if (location != null) {
Endpoint endpoint = STSUtils.createSTSEndpoint(bus, namespace, null, location, soapVersion,
policy, endpointName);
client = new ClientImpl(bus, endpoint);
+ } else {
+ throw new TrustException(LOG, "NO_LOCATION");
}
client.getInFaultInterceptors().addAll(inFault);
http://git-wip-us.apache.org/repos/asf/cxf/blob/68372daf/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 d301c27..570dacd 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
@@ -27,3 +27,4 @@ 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
+NO_LOCATION=The STSClient is not configured with either a location or wsdlLocation property