use of javax.wsdl.factory.WSDLFactory in project Activiti by Activiti.
the class WSDLImporter method parseWSDLDefinition.
/**
* Parse the WSDL definition using WSDL4J.
*/
private Definition parseWSDLDefinition() throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition definition = reader.readWSDL(this.wsdlLocation);
return definition;
}
use of javax.wsdl.factory.WSDLFactory in project wso2-synapse by wso2.
the class WSDL11EndpointBuilder method populateEndpointDefinitionFromWSDL.
/**
* Creates an EndpointDefinition for WSDL endpoint from an inline WSDL supplied in the WSDL
* endpoint configuration.
*
* @param endpointDefinition the endpoint definition to populate
* @param baseUri base uri of the wsdl
* @param wsdl OMElement representing the inline WSDL
* @param service Service of the endpoint
* @param port Port of the endpoint
* @return EndpointDefinition containing the information retrieved from the WSDL
*/
public EndpointDefinition populateEndpointDefinitionFromWSDL(EndpointDefinition endpointDefinition, String baseUri, OMElement wsdl, String service, String port) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
wsdl.serialize(baos);
InputStream in = new ByteArrayInputStream(baos.toByteArray());
InputSource inputSource = new InputSource(in);
WSDLLocator wsdlLocator = new CustomWSDLLocator(inputSource, baseUri);
Document doc = null;
try {
doc = XMLUtils.newDocument(inputSource);
} catch (ParserConfigurationException e) {
handleException("Parser Configuration Error", e);
} catch (SAXException e) {
handleException("Parser SAX Error", e);
} catch (IOException e) {
handleException(WSDLException.INVALID_WSDL + "IO Error", e);
}
if (doc != null) {
WSDLFactory fac = WSDLFactory.newInstance();
WSDLReader reader = fac.newWSDLReader();
Definition definition = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
return createEndpointDefinitionFromWSDL(endpointDefinition, definition, service, port);
}
} catch (XMLStreamException e) {
handleException("Error retrieving the WSDL definition from the inline WSDL.", e);
} catch (WSDLException e) {
handleException("Error retrieving the WSDL definition from the inline WSDL.", e);
}
return null;
}
use of javax.wsdl.factory.WSDLFactory in project teiid by teiid.
the class WSDLMetadataProcessor method process.
@Override
public void process(MetadataFactory mf, WSConnection connection) throws TranslatorException {
if (this.importWSDL && connection == null) {
throw new TranslatorException(WSExecutionFactory.UTIL.gs(Event.TEIID15007, WSExecutionFactory.UTIL.gs(Event.TEIID15007)));
}
if (!importWSDL || connection.getWsdl() == null) {
return;
}
String wsdl = connection.getWsdl().toString();
try {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
this.definition = reader.readWSDL(wsdl);
} catch (WSDLException e) {
throw new TranslatorException(e);
}
Map<QName, Service> services = this.definition.getServices();
if (services == null || services.isEmpty()) {
throw new TranslatorException(WSExecutionFactory.UTIL.gs(WSExecutionFactory.Event.TEIID15001, connection.getServiceQName()));
}
Service service = services.get(connection.getServiceQName());
if (service == null) {
throw new TranslatorException(WSExecutionFactory.UTIL.gs(WSExecutionFactory.Event.TEIID15001, connection.getServiceQName()));
}
Map<String, Port> ports = service.getPorts();
Port port = ports.get(connection.getPortQName().getLocalPart());
if (port == null) {
throw new TranslatorException(WSExecutionFactory.UTIL.gs(WSExecutionFactory.Event.TEIID15002, connection.getPortQName(), connection.getServiceQName()));
}
getPortMetadata(mf, port);
}
use of javax.wsdl.factory.WSDLFactory in project ofbiz-framework by apache.
the class ModelService method toWSDL.
public Document toWSDL(String locationURI) throws WSDLException {
WSDLFactory factory = WSDLFactory.newInstance();
Definition def = factory.newDefinition();
def.setTargetNamespace(TNS);
def.addNamespace("xsd", XSD);
def.addNamespace("tns", TNS);
def.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
this.getWSDL(def, locationURI);
return factory.newWSDLWriter().getDocument(def);
}
use of javax.wsdl.factory.WSDLFactory in project jbossws-cxf by jbossws.
the class JBossWebServicesEarTestCase method getWSDLDefinition.
private Definition getWSDLDefinition(String wsdlLocation) throws Exception {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
return definition;
}
Aggregations