• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WSDLModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.ws.api.model.wsdl.WSDLModel的典型用法代码示例。如果您正苦于以下问题:Java WSDLModel类的具体用法?Java WSDLModel怎么用?Java WSDLModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WSDLModel类属于com.sun.xml.internal.ws.api.model.wsdl包,在下文中一共展示了WSDLModel类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configureModel

import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; //导入依赖的package包/类
/**
 * Iterates through the ports in the WSDL model, for each policy in the policy
 * map that is attached at endpoint scope computes a list of corresponding
 * WebServiceFeatures and sets them on the port.
 *
 * @param model The WSDL model
 * @param policyMap The policy map
 * @throws PolicyException If the list of WebServiceFeatures could not be computed
 */
public static void configureModel(final WSDLModel model, PolicyMap policyMap) throws PolicyException {
    LOGGER.entering(model, policyMap);
    for (WSDLService service : model.getServices().values()) {
        for (WSDLPort port : service.getPorts()) {
            final Collection<WebServiceFeature> features = getPortScopedFeatures(policyMap, service.getName(), port.getName());
            for (WebServiceFeature feature : features) {
                port.addFeature(feature);
                port.getBinding().addFeature(feature);
            }
        }
    }
    LOGGER.exiting();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:PolicyUtil.java


示例2: parse

import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; //导入依赖的package包/类
/**
 * Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
 * document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
 * then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
 *
 * @param wsdlLoc
 *      Either this or <tt>wsdl</tt> parameter must be given.
 *      Null location means the system won't be able to resolve relative references in the WSDL,
 */
public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver,
                                  boolean isClientSide, Container container, Class serviceClass,
                                  @NotNull PolicyResolver policyResolver,
                                  boolean isUseStreamFromEntityResolverWrapper,
                                  WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;

    RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver, isUseStreamFromEntityResolverWrapper), isClientSide, container, policyResolver, extensions);
    Parser parser;
    try{
        parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource, serviceClass);
        if(!hasWSDLDefinitions(parser.parser)){
            throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
                    WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
        }
    }catch(XMLStreamException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);

    }catch(IOException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
    }
    wsdlParser.extensionFacade.start(wsdlParser.context);
    wsdlParser.parseWSDL(parser, false);
    wsdlParser.wsdlDoc.freeze();
    wsdlParser.extensionFacade.finished(wsdlParser.context);
    wsdlParser.extensionFacade.postFinished(wsdlParser.context);

    if(wsdlParser.wsdlDoc.getServices().isEmpty())
        throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));

    return wsdlParser.wsdlDoc;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:RuntimeWSDLParser.java


示例3: parse

import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; //导入依赖的package包/类
/**
 * Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
 * document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
 * then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
 *
 * @param wsdlLoc
 *      Either this or {@code wsdl} parameter must be given.
 *      Null location means the system won't be able to resolve relative references in the WSDL,
 */
public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver,
                                  boolean isClientSide, Container container, Class serviceClass,
                                  @NotNull PolicyResolver policyResolver,
                                  boolean isUseStreamFromEntityResolverWrapper,
                                  WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;

    RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver, isUseStreamFromEntityResolverWrapper), isClientSide, container, policyResolver, extensions);
    Parser parser;
    try{
        parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource, serviceClass);
        if(!hasWSDLDefinitions(parser.parser)){
            throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
                    WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
        }
    }catch(XMLStreamException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);

    }catch(IOException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
    }
    wsdlParser.extensionFacade.start(wsdlParser.context);
    wsdlParser.parseWSDL(parser, false);
    wsdlParser.wsdlDoc.freeze();
    wsdlParser.extensionFacade.finished(wsdlParser.context);
    wsdlParser.extensionFacade.postFinished(wsdlParser.context);

    if(wsdlParser.wsdlDoc.getServices().isEmpty())
        throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));

    return wsdlParser.wsdlDoc;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:48,代码来源:RuntimeWSDLParser.java


示例4: WSDLParserExtensionContextImpl

import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; //导入依赖的package包/类
/**
 * Construct {@link WSDLParserExtensionContextImpl} with information that whether its on client side
 * or server side.
 */
protected WSDLParserExtensionContextImpl(WSDLModel model, boolean isClientSide, Container container, PolicyResolver policyResolver) {
    this.wsdlModel = model;
    this.isClientSide = isClientSide;
    this.container = container;
    this.policyResolver = policyResolver;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:11,代码来源:WSDLParserExtensionContextImpl.java


示例5: getPortNameFromEPR

import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; //导入依赖的package包/类
/**
 *
 * @param wsepr EndpointReference from which portName will be extracted.
 *      If EndpointName ( port name) is null in EPR, then it will try to get if from WSDLModel using portType QName
 * @param portTypeName
 *          should be null in dispatch case
 *          should be non null in SEI case
 * @return
 *      port name from EPR after validating various metadat elements.
 *      Also if service instance does n't have wsdl,
 *      then it gets the WSDL metadata from EPR and builds wsdl model.
 */
private QName getPortNameFromEPR(@NotNull WSEndpointReference wsepr, @Nullable QName portTypeName) {
    QName portName;
    WSEndpointReference.Metadata metadata = wsepr.getMetaData();
    QName eprServiceName = metadata.getServiceName();
    QName eprPortName = metadata.getPortName();
    if ((eprServiceName != null ) && !eprServiceName.equals(serviceName)) {
        throw new WebServiceException("EndpointReference WSDL ServiceName differs from Service Instance WSDL Service QName.\n"
                + " The two Service QNames must match");
    }
    if (wsdlService == null) {
        Source eprWsdlSource = metadata.getWsdlSource();
        if (eprWsdlSource == null) {
            throw new WebServiceException(ProviderApiMessages.NULL_WSDL());
        }
        try {
            WSDLModel eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource, null);
            wsdlService = eprWsdlMdl.getService(serviceName);
            if (wsdlService == null)
                throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME(serviceName,
                        buildNameList(eprWsdlMdl.getServices().keySet())));
        } catch (MalformedURLException e) {
            throw new WebServiceException(ClientMessages.INVALID_ADDRESS(wsepr.getAddress()));
        }
    }
    portName = eprPortName;

    if (portName == null && portTypeName != null) {
        //get the first port corresponding to the SEI
        WSDLPort port = wsdlService.getMatchingPort(portTypeName);
        if (port == null)
            throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
        portName = port.getName();
    }
    if (portName == null)
        throw new WebServiceException(ProviderApiMessages.NULL_PORTNAME());
    if (wsdlService.get(portName) == null)
        throw new WebServiceException(ClientMessages.INVALID_EPR_PORT_NAME(portName, buildWsdlPortNames()));

    return portName;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:54,代码来源:WSServiceDelegate.java


示例6: getWSDLModel

import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; //导入依赖的package包/类
public WSDLModel getWSDLModel() {
    return wsdlModel;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:4,代码来源:WSDLParserExtensionContextImpl.java



注:本文中的com.sun.xml.internal.ws.api.model.wsdl.WSDLModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ValueMetaDate类代码示例发布时间:2022-05-23
下一篇:
Java DatabaseConfiguration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap