Search in sources :

Example 1 with WSDLRuntimeException

use of org.apache.cxf.wsdl11.WSDLRuntimeException in project cxf by apache.

the class WSDLDefinitionBuilder method parseWSDL.

@SuppressWarnings("unchecked")
protected void parseWSDL(String wsdlURL) {
    try {
        WSDLManager mgr = bus.getExtension(WSDLManager.class);
        registerWSDLExtensibilityPlugins(mgr.getExtensionRegistry());
        wsdlDefinition = mgr.getDefinition(wsdlURL);
        parseImports(wsdlDefinition);
        if (wsdlDefinition.getServices().isEmpty()) {
            for (Definition def : importedDefinitions) {
                Set<QName> services = def.getServices().keySet();
                for (QName sName : services) {
                    if (!wsdlDefinition.getServices().keySet().contains(sName)) {
                        wsdlDefinition.getServices().put(sName, def.getService(sName));
                    }
                }
            }
        }
    } catch (Exception we) {
        Message msg = new Message("FAIL_TO_CREATE_WSDL_DEFINITION", LOG, wsdlURL, we.getMessage());
        throw new WSDLRuntimeException(msg, we);
    }
}
Also used : Message(org.apache.cxf.common.i18n.Message) QName(javax.xml.namespace.QName) Definition(javax.wsdl.Definition) WSDLManager(org.apache.cxf.wsdl.WSDLManager) WSDLRuntimeException(org.apache.cxf.wsdl11.WSDLRuntimeException) WSDLRuntimeException(org.apache.cxf.wsdl11.WSDLRuntimeException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Definition (javax.wsdl.Definition)1 QName (javax.xml.namespace.QName)1 Message (org.apache.cxf.common.i18n.Message)1 WSDLManager (org.apache.cxf.wsdl.WSDLManager)1 WSDLRuntimeException (org.apache.cxf.wsdl11.WSDLRuntimeException)1