// using axiom (dude, you are becoming handy here :)), we will not build the
// whole thing.
OMElement element = (OMElement) XMLUtils.toOM(in);
OMNamespace documentElementNS = element.getNamespace();
if (documentElementNS != null) {
WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder;
ByteArrayOutputStream out = new ByteArrayOutputStream();
element.serialize(out);
if (Constants.NS_URI_WSDL11.
equals(documentElementNS.getNamespaceURI())) {
wsdlToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(
new ByteArrayInputStream(out.toByteArray()));
((WSDL11ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).setCustomWSDLResolver(new WarBasedWSDLLocator(wsdlUrl,
loader,
new ByteArrayInputStream(
out.toByteArray())));
wsdlToAxisServiceBuilder.setCustomResolver(
new WarFileBasedURIResolver(loader));
return ((WSDL11ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).populateAllServices();
} else if (WSDL2Constants.WSDL_NAMESPACE.
equals(documentElementNS.getNamespaceURI())){
wsdlToAxisServiceBuilder = new WSDL20ToAllAxisServicesBuilder(
new ByteArrayInputStream(out.toByteArray()));
((WSDL20ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).setCustomWSDLResolver(new WarBasedWSDLLocator(wsdlUrl,
loader,
new ByteArrayInputStream(
out.toByteArray())));
wsdlToAxisServiceBuilder.setCustomResolver(
new WarFileBasedURIResolver(loader));
return ((WSDL20ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).populateAllServices();
}
else {
throw new DeploymentException(Messages.getMessage("invalidWSDLFound"));