proxyService.addOperation(mediateOperation);
}
// if a WSDL was found
if (wsdlElement != null) {
OMNamespace wsdlNamespace = wsdlElement.getNamespace();
// serialize and create an inputstream to read WSDL
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
if (trace()) trace.info("Serializing wsdlElement found to build an Axis2 service");
wsdlElement.serialize(baos);
wsdlInputStream = new ByteArrayInputStream(baos.toByteArray());
} catch (XMLStreamException e) {
handleException("Error converting to a StreamSource", e);
}
if (wsdlInputStream != null) {
try {
// detect version of the WSDL 1.1 or 2.0
if (trace()) trace.info("WSDL Namespace is : "
+ wsdlNamespace.getNamespaceURI());
if (wsdlNamespace != null) {
WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;
if (WSDL2Constants.WSDL_NAMESPACE.
equals(wsdlNamespace.getNamespaceURI())) {
wsdlToAxisServiceBuilder =
new WSDL20ToAxisServiceBuilder(wsdlInputStream, null, null);
} else if (org.apache.axis2.namespace.Constants.NS_URI_WSDL11.
equals(wsdlNamespace.getNamespaceURI())) {
wsdlToAxisServiceBuilder =
new WSDL11ToAxisServiceBuilder(wsdlInputStream);
} else {
handleException("Unknown WSDL format.. not WSDL 1.1 or WSDL 2.0");
}