You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ba...@apache.org on 2007/04/11 18:04:21 UTC
svn commit: r527551 -
/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
Author: barrettj
Date: Wed Apr 11 09:04:20 2007
New Revision: 527551
URL: http://svn.apache.org/viewvc?view=rev&rev=527551
Log:
Add a few NPE guards
Modified:
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=527551&r1=527550&r2=527551
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Wed Apr 11 09:04:20 2007
@@ -316,10 +316,13 @@
private Class getEndpointSEI(QName portQName) {
Class endpointSEI = null;
- EndpointInterfaceDescription endpointInterfaceDesc =
- getEndpointDescription(portQName).getEndpointInterfaceDescription();
- if (endpointInterfaceDesc != null) {
- endpointSEI = endpointInterfaceDesc.getSEIClass();
+ EndpointDescription endpointDesc = getEndpointDescription(portQName);
+ if (endpointDesc != null) {
+ EndpointInterfaceDescription endpointInterfaceDesc =
+ endpointDesc.getEndpointInterfaceDescription();
+ if (endpointInterfaceDesc != null ) {
+ endpointSEI = endpointInterfaceDesc.getSEIClass();
+ }
}
return endpointSEI;
}
@@ -546,8 +549,28 @@
* @see org.apache.axis2.jaxws.description.ServiceDescription#getServiceClient(javax.xml.namespace.QName)
*/
public ServiceClient getServiceClient(QName portQName) {
- // TODO: RAS if no portQName found
- return getEndpointDescription(portQName).getServiceClient();
+ ServiceClient returnServiceClient = null;
+ if (!DescriptionUtils.isEmpty(portQName)) {
+ EndpointDescription endpointDesc = getEndpointDescription(portQName);
+ if (endpointDesc != null) {
+ returnServiceClient = endpointDesc.getServiceClient();
+ }
+ else {
+ // Couldn't find Endpoint Description for port QName
+ if (log.isDebugEnabled()) {
+ log.debug("Could not find portQName: " + portQName
+ + " under ServiceDescription: " + toString());
+ }
+ }
+ }
+ else {
+ // PortQName is empty
+ if (log.isDebugEnabled()) {
+ log.debug("PortQName agrument is invalid; it can not be null or an empty string: " + portQName);
+ }
+ }
+
+ return returnServiceClient;
}
/* (non-Javadoc)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org