WSDLFactory wsdlFactory,
XSDFactory xsdFactory,
Monitor monitor) {
WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract();
WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
wsdlContract.setInterface(wsdlInterface);
WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
JavaInterface iface = (JavaInterface)contract.getInterface();
Definition def = null;
try {
Interface2WSDLGenerator wsdlGenerator =
new Interface2WSDLGenerator(requiresSOAP12, resolver, dataBindings, xsdFactory, monitor);
def = wsdlGenerator.generate(iface, wsdlDefinition);
} catch (WSDLException e) {
throw new WSDLGenerationException(e);
}
// for debugging
if (printWSDL) {
try {
System.out.println("Generated WSDL for Java interface " + iface.getName() + " class " + iface.getJavaClass().getName());
WSDLWriter writer = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
writer.writeWSDL(def, System.out);
} catch (WSDLException e) {
throw new WSDLGenerationException(e);
}
}
wsdlDefinition.setDefinition(def);
wsdlInterface.setWsdlDefinition(wsdlDefinition);
wsdlInterface.setRemotable(true);
wsdlInterface.setConversational(contract.getInterface().isConversational());
wsdlInterface.setUnresolved(false);
wsdlInterface.setRemotable(true);
PortType portType = (PortType)def.getAllPortTypes().values().iterator().next();
wsdlInterface.setPortType(portType);
try {
wsdlFactory.createWSDLInterface(wsdlInterface, portType, wsdlDefinition, resolver);
} catch (InvalidInterfaceException e) {
throw new WSDLGenerationException(e);