当前位置: 首页>>代码示例>>Java>>正文


Java WSDLFactory.newInstance方法代码示例

本文整理汇总了Java中javax.wsdl.factory.WSDLFactory.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java WSDLFactory.newInstance方法的具体用法?Java WSDLFactory.newInstance怎么用?Java WSDLFactory.newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.wsdl.factory.WSDLFactory的用法示例。


在下文中一共展示了WSDLFactory.newInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateVersion

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
void validateVersion(String wsdlUrl) {
    WSDLLocator locator = new BasicAuthWSDLLocator(wsdlUrl, null, null);
    WSDLFactory wsdlFactory;
    Definition serviceDefinition;
    try {
        wsdlFactory = WSDLFactory.newInstance();
        WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
        // avoid importing external documents
        wsdlReader.setExtensionRegistry(new WSVersionExtensionRegistry());
        serviceDefinition = wsdlReader.readWSDL(locator);
        Element versionElement = serviceDefinition
                .getDocumentationElement();
        if (!CTMGApiVersion.version.equals(versionElement.getTextContent())) {
            LOGGER.warn("Web service mismatches and the version value, expected: "
                    + CTMGApiVersion.version
                    + " and the one got from wsdl: "
                    + versionElement.getTextContent());
        }
    } catch (WSDLException e) {
        LOGGER.warn("Remote wsdl cannot be retrieved from CT_MG. [Cause: "
                + e.getMessage() + "]", e);
    }

}
 
开发者ID:servicecatalog,项目名称:development,代码行数:25,代码来源:BesDAO.java

示例2: getWSDL11Parser

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
public static synchronized WSDL11Parser getWSDL11Parser(String wsdlLocation) throws WSDLException, IOException {
    WSDL11Parser parser = null;
    
    if (parsers == null) {
        parsers = new TreeMap<String, WSDL11Parser>();
    } else {
        parser = parsers.get(wsdlLocation);
    }
    
    if (parser == null) {
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        Definition definition = reader.readWSDL(wsdlLocation);

        parser = new WSDL11Parser(definition);
        
        parsers.put(wsdlLocation, parser);
    }
    
    return parser;
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:23,代码来源:WSDL11Parser.java

示例3: readWSDL

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
/**
 * Read the WSDL document and create a WSDL Definition.
 *
 * @param wsdlLocation location pointing to a WSDL XML definition.
 * @return the Definition.
 * @throws WSDLException If unable to read the WSDL
 */
public static Definition readWSDL(final String wsdlLocation) throws WSDLException {
    InputStream inputStream = null;
    try {
        URL url = getURL(wsdlLocation);
        inputStream = url.openStream();
        InputSource source = new InputSource(inputStream);
        source.setSystemId(url.toString());
        Document wsdlDoc = XMLHelper.getDocument(source);
        WSDLFactory wsdlFactory = WSDLFactory.newInstance();
        WSDLReader reader = wsdlFactory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        return reader.readWSDL(url.toString(), wsdlDoc);
    } catch (Exception e) {
        throw new WSDLException(WSDLException.OTHER_ERROR,
                SOAPMessages.MESSAGES.unableToReadWSDL(wsdlLocation), e);
    } finally {
        if (inputStream != null) {
            try {
                inputStream.close();
            } catch (IOException ioe) {
                LOGGER.error(ioe);
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:33,代码来源:WSDLUtil.java

示例4: toWSDL

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
/**
 * Generates WSDL-document from this web service model
 * @param dispatchContext dispatch context where nested service models
 *        can be found
 * @param locationURI SOAP location URI
 * @return WSDL-document object model
 * @throws GenericServiceException if exception encountered when
 *         getting nested service model
 * @throws SAXException if XML-schema could not be parsed
 * @throws WSDLException if XML-schema type could not be found
 */
public Document toWSDL(DispatchContext dispatchContext, String locationURI)  throws GenericServiceException, ParserConfigurationException,
           SAXException, TransformerException, WSDLException {
    if (this.wsdl != null) {
        return this.wsdl;
    }
    WSDLFactory factory = WSDLFactory.newInstance();
    Definition definition = factory.newDefinition();
    definition.setTargetNamespace(namespace);
    definition.addNamespace("tns", namespace);
    definition.addNamespace("xsd", ModelService.XSD);
    definition.addNamespace("soap", SOAP);
    definition.addNamespace("wsse", WSSE);
    
    this.wsdl = modelService.generateWSDL(dispatchContext.getDelegator(), locationURI);
    SchemaImpl schemaImpl = makeSchemaImpl(wsdl, namespace);
    
    Element schema = schemaImpl.getElement();
    wsdlSchema = makeValidationSchema(schema);
    return this.wsdl;
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:32,代码来源:SoapService.java

示例5: createWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
static Definition createWSDLDefinition(URL wsdlURL) {
    Definition wsdlDefinition = null;
    try {
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        wsdlDefinition = reader.readWSDL(wsdlURL.toString());
    }
    catch (Exception e) {
        TestLogger.logger
                .debug("*** ERROR ***: Caught exception trying to create WSDL Definition: " +
                        e);
        e.printStackTrace();
    }

    return wsdlDefinition;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:DescriptionTestUtils2.java

示例6: createWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
static public Definition createWSDLDefinition(URL wsdlURL) {
    Definition wsdlDefinition = null;
    try {
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        wsdlDefinition = reader.readWSDL(wsdlURL.toString());
        wsdlDefinition.setDocumentBaseURI(wsdlURL.toString());
    }
    catch (Exception e) {
        System.out.println(
                "*** ERROR ***: Caught exception trying to create WSDL Definition: " + e);
        e.printStackTrace();
    }

    return wsdlDefinition;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:DescriptionTestUtils.java

示例7: readWsdl

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
public static Definition readWsdl(URL wsdlURL) {
	Definition definition = null;
	try {
		if (wsdlURL != null) {
			WSDLFactory factory = WSDLFactory.newInstance();
			WSDLReader reader = factory.newWSDLReader();
			//reader.setFeature("javax.wsdl.importDocuments", true);
			definition = reader.readWSDL(null, wsdlURL.toString());
		}
	}
	catch (Throwable t) {
		Engine.logEngine.error("(WSDLUtils) error while reading WSDL", t);
	}
	return definition;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:16,代码来源:WSDLUtils.java

示例8: toWSDL

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
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);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:11,代码来源:ModelService.java

示例9: parseWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
/**
 * Parse the WSDL definition using WSDL4J.
 */
protected 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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:WSDLImporter.java

示例10: getWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
private Definition getWSDLDefinition(final String wsdlLocation) throws Exception
{
   WSDLFactory wsdlFactory = WSDLFactory.newInstance();
   WSDLReader wsdlReader = wsdlFactory.newWSDLReader();

   return wsdlReader.readWSDL(null, wsdlLocation);
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:8,代码来源:JBWS2960TestCase.java

示例11: getWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
{
   WSDLFactory wsdlFactory = WSDLFactory.newInstance();
   WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
   wsdlReader.setFeature("javax.wsdl.importDocuments", false);
   wsdlReader.setFeature("javax.wsdl.verbose", false);

   Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
   return definition;
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:11,代码来源:JBWS2150TestCase.java

示例12: getWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
{
   WSDLFactory wsdlFactory = WSDLFactory.newInstance();
   WSDLReader wsdlReader = wsdlFactory.newWSDLReader();

   Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
   return definition;
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:9,代码来源:JBossWebServicesEarTestCase.java

示例13: parseWSDLDefinition

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:WSDLImporter.java

示例14: WSDLMetadataProcessor

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
public WSDLMetadataProcessor(String wsdl) throws TranslatorException {
	try {
		WSDLFactory wsdlFactory = WSDLFactory.newInstance();
		WSDLReader reader = wsdlFactory.newWSDLReader();
		this.definition = reader.readWSDL(wsdl);
	} catch (WSDLException e) {
		throw new TranslatorException(e);
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:10,代码来源:WSDLMetadataProcessor.java

示例15: generateWSDL

import javax.wsdl.factory.WSDLFactory; //导入方法依赖的package包/类
public Document generateWSDL(Delegator delegator, 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.buildWSDL(delegator, def, locationURI);
    return factory.newWSDLWriter().getDocument(def);
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:11,代码来源:ModelService.java


注:本文中的javax.wsdl.factory.WSDLFactory.newInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。