// locationUrl = url;
// interfaceNamespace = url;
// }
// }
Emitter emitter = new Emitter();
// This seems like a good idea, but in fact isn't because the
// emitter will figure out a reasonable name (<classname>Service)
// for the WSDL service element name. We provide the 'alias'
// setting to explicitly set this name. See bug 13262 for more info.
//emitter.setServiceElementName(serviceDesc.getName());
// service alias may be provided if exact naming is required,
// otherwise Axis will name it according to the implementing class name
String alias = (String) service.getOption("alias");
if (alias != null)
emitter.setServiceElementName(alias);
// Set style/use
emitter.setStyle(serviceDesc.getStyle());
emitter.setUse(serviceDesc.getUse());
if (serviceDesc instanceof JavaServiceDesc) {
emitter.setClsSmart(((JavaServiceDesc)serviceDesc).getImplClass(),
locationUrl);
}
// If a wsdl target namespace was provided, use the targetNamespace.
// Otherwise use the interfaceNamespace constructed above.
String targetNamespace = (String) service.getOption(OPTION_WSDL_TARGETNAMESPACE);
if (targetNamespace == null || targetNamespace.length() == 0) {
targetNamespace = interfaceNamespace;
}
emitter.setIntfNamespace(targetNamespace);
emitter.setLocationUrl(locationUrl);
emitter.setServiceDesc(serviceDesc);
emitter.setTypeMapping((TypeMapping) msgContext.getTypeMappingRegistry().getTypeMapping(serviceDesc.getUse().getEncoding()));
emitter.setDefaultTypeMapping((TypeMapping) msgContext.getTypeMappingRegistry().getDefaultTypeMapping());
String wsdlPortType = (String) service.getOption(OPTION_WSDL_PORTTYPE);
String wsdlServiceElement = (String) service.getOption(OPTION_WSDL_SERVICEELEMENT);
String wsdlServicePort = (String) service.getOption(OPTION_WSDL_SERVICEPORT);
if (wsdlPortType != null && wsdlPortType.length() > 0) {
emitter.setPortTypeName(wsdlPortType);
}
if (wsdlServiceElement != null && wsdlServiceElement.length() > 0) {
emitter.setServiceElementName(wsdlServiceElement);
}
if (wsdlServicePort != null && wsdlServicePort.length() > 0) {
emitter.setServicePortName(wsdlServicePort);
}
String wsdlInputSchema = (String) service.getOption(OPTION_WSDL_INPUTSCHEMA);
if (null != wsdlInputSchema && wsdlInputSchema.length() > 0) {
emitter.setInputSchema(wsdlInputSchema);
}
Document doc = emitter.emit(Emitter.MODE_ALL);
msgContext.setProperty("WSDL", doc);
} catch (NoClassDefFoundError e) {
entLog.info(Messages.getMessage("toAxisFault00"), e);
throw new AxisFault(e.toString(), e);