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


Java WSPortConnector类代码示例

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


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

示例1: getOperationServiceAdapter

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
public static OperationServiceAdapter getOperationServiceAdapter(
        TechnicalProductOperation operation, Integer wsTimeout,
        String username, String password) throws IOException,
        WSDLException, ParserConfigurationException {

    String target = operation.getActionUrl();
    if (Strings.isEmpty(target)) {
        throw new SaaSSystemException(
                String.format(
                        "Failed to retrieve service endpoint for service operation '%s', as the target is not defined.",
                        Long.valueOf(operation.getKey())));
    }
    WSPortConnector portConnector = new WSPortConnector(target, username,
            password);

    SupportedOperationVersions supportedVersion = getSupportedVersion(portConnector);
    OperationServiceAdapter adapter = getAdapterForVersion(supportedVersion);
    final Object port = portConnector.getPort(
            supportedVersion.getLocalWSDL(),
            supportedVersion.getServiceClass(), wsTimeout);
    adapter.setOperationService(port);
    return adapter;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:24,代码来源:OperationServiceAdapterFactory.java

示例2: getSupportedVersion

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
SupportedVersions getSupportedVersion(WSPortConnector portConnector) {
    WSPortDescription portDescription = portConnector.getPortDescription();
    String targetNamespaceFromWsdl = portDescription.getTargetNamespace();
    SupportedVersions supportedNS = SupportedVersions
            .getForVersion(portDescription.getVersion());
    if (supportedNS == null) {
        supportedNS = SupportedVersions
                .getForNamespaceString(targetNamespaceFromWsdl);
    }
    if (supportedNS == null) {
        String message = "Unsupported namespace for PaymentServiceProvider: %s";
        throw new SaaSSystemException(String.format(message,
                targetNamespaceFromWsdl));
    }
    return supportedNS;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:PortLocatorBean.java

示例3: getSupportedVersion

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
static SupportedVersions getSupportedVersion(WSPortConnector portConnector) {
    WSPortDescription portDescription = portConnector.getPortDescription();
    String targetVersionFromWsdl = portDescription.getVersion();
    SupportedVersions supportedVersion = SupportedVersions
            .getForVersionString(targetVersionFromWsdl);
    if (supportedVersion == null) {
        String targetNamespaceFromWsdl = portDescription
                .getTargetNamespace();
        supportedVersion = SupportedVersions
                .getForNamespaceString(targetNamespaceFromWsdl);
        if (supportedVersion == null) {
            String message = "Unsupported namespace for NotifcationService: %s";
            throw new SaaSSystemException(String.format(message,
                    targetNamespaceFromWsdl));
        }
    }
    return supportedVersion;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:NotificationServiceAdapterFactory.java

示例4: getSupportedVersion

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
static SupportedOperationVersions getSupportedVersion(
        WSPortConnector portConnector) {
    WSPortDescription portDescription = portConnector.getPortDescription();
    String targetVersionFromWsdl = portDescription.getVersion();
    SupportedOperationVersions supportedVersion = SupportedOperationVersions
            .getForVersionString(targetVersionFromWsdl);
    if (supportedVersion == null) {
        supportedVersion = SupportedOperationVersions.VERSION_1_5;
    }
    return supportedVersion;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:OperationServiceAdapterFactory.java

示例5: getPort

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
@Override
public PaymentServiceProviderAdapter getPort(String wsdl)
        throws IOException, WSDLException, ParserConfigurationException {

    WSPortConnector portConnector = new WSPortConnector(wsdl, null, null);

    SupportedVersions supportedNS = getSupportedVersion(portConnector);
    PaymentServiceProviderAdapter adapter = getAdapterForNamespace(supportedNS);

    final Object port = portConnector.getPort(supportedNS.getLocalWSDL(),
            supportedNS.getServiceClass(), timeout);
    adapter.setPaymentServiceProviderService(port);

    return adapter;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:16,代码来源:PortLocatorBean.java

示例6: setup

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    pcMock = mock(WSPortConnector.class);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:5,代码来源:NotificationServiceAdapterFactoryTest.java

示例7: getNotificationServiceAdapter

import org.oscm.ws.WSPortConnector; //导入依赖的package包/类
public static INotificationServiceAdapter getNotificationServiceAdapter(
        TriggerDefinition td, Integer wsTimeout,
        ConfigurationServiceLocal cs, DataService ds) throws IOException,
        WSDLException, ParserConfigurationException {

    String target = td.getTarget();
    if (target == null) {
        throw new SaaSSystemException(
                String.format(
                        "Failed to retrieve service endpoint for trigger definition '%s', as the target is not defined.",
                        Long.valueOf(td.getKey())));
    }

    INotificationServiceAdapter adapter = null;

    switch (td.getTargetType()) {
    case WEB_SERVICE:
        WSPortConnector portConnector = new WSPortConnector(target, null,
                null);

        SupportedVersions supportedVersion = getSupportedVersion(portConnector);
        adapter = getAdapterForVersion(supportedVersion, ds);

        final Object port = portConnector.getPort(
                supportedVersion.getLocalWSDL(),
                supportedVersion.getServiceClass(), wsTimeout);
        initAdapter(cs, ds, adapter, port);
        break;
    case REST_SERVICE:

        Client c = ClientBuilder.newClient();
        WebTarget r = c.target(td.getTarget());

        adapter = new RestNotificationServiceAdapter();
        initAdapter(cs, ds, adapter, r);

        break;

    default:
        throw new SaaSSystemException(
                String.format(
                        "Failed to retrieve service endpoint for trigger definition '%s', as the target type is not defined.",
                        Long.valueOf(td.getKey())));
    }

    return adapter;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:48,代码来源:NotificationServiceAdapterFactory.java


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