You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2008/04/18 09:32:25 UTC
svn commit: r649392 -
/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java
Author: ruwan
Date: Fri Apr 18 00:32:21 2008
New Revision: 649392
URL: http://svn.apache.org/viewvc?rev=649392&view=rev
Log:
Fixing an issue with building proxy services
Modified:
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java
Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java?rev=649392&r1=649391&r2=649392&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java (original)
+++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java Fri Apr 18 00:32:21 2008
@@ -225,6 +225,7 @@
InputStream wsdlInputStream = null;
OMElement wsdlElement = null;
+ boolean wsdlFound = false;
if (wsdlKey != null) {
synCfg.getEntryDefinition(wsdlKey);
@@ -232,8 +233,10 @@
if (keyObject instanceof OMElement) {
wsdlElement = (OMElement) keyObject;
}
+ wsdlFound = true;
} else if (inLineWSDL != null) {
wsdlElement = (OMElement) inLineWSDL;
+ wsdlFound = true;
} else if (wsdlURI != null) {
try {
URL url = wsdlURI.toURL();
@@ -241,15 +244,23 @@
if (node instanceof OMElement) {
wsdlElement = (OMElement) node;
}
+ wsdlFound = true;
} catch (MalformedURLException e) {
handleException("Malformed URI for wsdl", e);
} catch (IOException e) {
handleException("Error reading from wsdl URI", e);
}
+ } else {
+ // this is for POX... create a dummy service and an operation for which
+ // our SynapseDispatcher will properly dispatch to
+ if (trace()) trace.info("Did not find a WSDL. Assuming a POX or Legacy service");
+ proxyService = new AxisService();
+ AxisOperation mediateOperation = new InOutAxisOperation(new QName("mediate"));
+ proxyService.addOperation(mediateOperation);
}
// if a WSDL was found
- if (wsdlElement != null) {
+ if (wsdlFound && wsdlElement != null) {
OMNamespace wsdlNamespace = wsdlElement.getNamespace();
// serialize and create an inputstream to read WSDL
@@ -352,12 +363,8 @@
}
}
} else {
- // this is for POX... create a dummy service and an operation for which
- // our SynapseDispatcher will properly dispatch to
- if (trace()) trace.info("Did not find a WSDL. Assuming a POX or Legacy service");
- proxyService = new AxisService();
- AxisOperation mediateOperation = new InOutAxisOperation(new QName("mediate"));
- proxyService.addOperation(mediateOperation);
+ handleException("Couldn't build the proxy service : " + name
+ + ". Unable to locate the specified WSDL to build the service");
}
// Set the name and description. Currently Axis2 uses the name as the