Search in sources :

Example 56 with WSDLException

use of javax.wsdl.WSDLException in project tesb-studio-se by Talend.

the class WSDLUtils method getDefinition.

// public static Definition getDefinition(String pathToWsdl) throws CoreException {
// try {
// WSDLFactory wsdlFactory = WSDLFactory.newInstance();
// WSDLReader newWSDLReader = wsdlFactory.newWSDLReader();
// 
// newWSDLReader.setExtensionRegistry(wsdlFactory.newPopulatedExtensionRegistry());
// newWSDLReader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false);
// return newWSDLReader.readWSDL(pathToWsdl);
// } catch (WSDLException e) {
// throw new CoreException(StatusUtil.newStatus(IStatus.ERROR, e.getLocalizedMessage(), e));
// }
// }
public static Definition getDefinition(IFile pathToWsdl) throws CoreException {
    try {
        WSDLFactory wsdlFactory = WSDLFactory.newInstance();
        WSDLReader newWSDLReader = wsdlFactory.newWSDLReader();
        newWSDLReader.setExtensionRegistry(wsdlFactory.newPopulatedExtensionRegistry());
        newWSDLReader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false);
        return newWSDLReader.readWSDL(pathToWsdl.getLocationURI().toString());
    } catch (WSDLException e) {
        throw getCoreException(null, e);
    }
}
Also used : WSDLFactory(javax.wsdl.factory.WSDLFactory) WSDLException(javax.wsdl.WSDLException) WSDLReader(javax.wsdl.xml.WSDLReader)

Aggregations

WSDLException (javax.wsdl.WSDLException)56 ToolException (org.apache.cxf.tools.common.ToolException)18 WSDLReader (javax.wsdl.xml.WSDLReader)14 IOException (java.io.IOException)13 Definition (javax.wsdl.Definition)12 Message (org.apache.cxf.common.i18n.Message)12 QName (javax.xml.namespace.QName)11 WSDLWriter (javax.wsdl.xml.WSDLWriter)10 APIMgtWSDLException (org.wso2.carbon.apimgt.impl.wsdl.exceptions.APIMgtWSDLException)7 File (java.io.File)6 Writer (java.io.Writer)6 HashMap (java.util.HashMap)6 Map (java.util.Map)6 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)6 Document (org.w3c.dom.Document)6 URL (java.net.URL)5 WSDLManager (org.apache.cxf.wsdl.WSDLManager)5 XMLStreamException (javax.xml.stream.XMLStreamException)4 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3