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

Java Responses类代码示例

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

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



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

示例1: createService

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Create a service as would be done via injection or lookup, including a sparse composite that 
 * contains features (as might be set by a deployment descriptor).
 * 
 * @return a Service created as done via injection or lookup.
 */
private Service createService() {
    // Even for a port injection or lookup, the service will also be treated as an injection or lookup
    // So we need to setup the sparse DBC to create the service
    QName serviceQName = new QName(namespaceURI, svcLocalPart);
    URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl);
    DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite();
    
    Map<String, List<Annotation>> map = new HashMap();
    ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>();
    AddressingAnnot addressingFeature = new AddressingAnnot();
    addressingFeature.setEnabled(true);
    addressingFeature.setRequired(true);
    addressingFeature.setResponses(Responses.NON_ANONYMOUS);
    wsFeatures.add(addressingFeature);
    map.put(ClientMetadataAddressingPortSEI.class.getName(), wsFeatures);
    serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map);
    ServiceDelegate.setServiceMetadata(serviceDBC);
    Service service = Service.create(wsdlUrl, serviceQName);
    return service;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:ClientMetadataAddressingFeatureTests.java


示例2: mapResponseAttributeToAddressing

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Given a value for the Addressing.responses annotation attribute, map it to the corresponding
 * Addressing constant to be set on the AxisSservice
 * 
 * @param responses Enum value from the Addressing.responses annotation attribute
 * @return String from AddressingContstants corresponding to the responses value.
 */
static public String mapResponseAttributeToAddressing(Responses responses) {
    String addressingType = null;
    switch (responses) {
        case ALL:
            addressingType = AddressingConstants.WSAM_INVOCATION_PATTERN_BOTH;
            break;
        case ANONYMOUS:
            addressingType = AddressingConstants.WSAM_INVOCATION_PATTERN_SYNCHRONOUS;
            break;
        case NON_ANONYMOUS:
            addressingType = AddressingConstants.WSAM_INVOCATION_PATTERN_ASYNCHRONOUS;
            break;
    }
    return addressingType;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:AddressingConfigurator.java


示例3: getAddressingResponses

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
public Responses getAddressingResponses(Object serviceDelegateKey, Class seiClass) {
    Responses responses = null;
    List<Annotation> seiFeatureList = getSEIFeatureList(serviceDelegateKey, seiClass);
    if (log.isDebugEnabled()) {
        log.debug("Feature list for delegate: " + serviceDelegateKey + ", and SEI: " + seiClass
                + ", is: " + seiFeatureList);
    }
    if (seiFeatureList != null) {
        for (int i = 0; i < seiFeatureList.size(); i++) {
            Annotation checkAnnotation = seiFeatureList.get(i);
            if (checkAnnotation instanceof AddressingAnnot) {
                AddressingAnnot addressingAnnot = (AddressingAnnot) checkAnnotation;
                responses = addressingAnnot.responses();
            }
        }
    }
    return responses;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:ServiceDescriptionImpl.java


示例4: testAddressingResponses

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
public void testAddressingResponses() {
    Service service = createService();
    ClientMetadataAddressingPortSEI port = service.getPort(ClientMetadataAddressingPortSEI.class);
    
    BindingProvider bindingProvider = (BindingProvider) port;
    SOAPBinding soapBinding = (SOAPBinding) bindingProvider.getBinding();
    assertTrue("Addressing is not configured", soapBinding.isAddressingConfigured());
    assertEquals("Addressing Responses incorrect", Responses.NON_ANONYMOUS, soapBinding.getAddressingResponses());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:10,代码来源:ClientMetadataAddressingFeatureTests.java


示例5: testDefaultAddressingValues

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
public void testDefaultAddressingValues() {
    QName serviceQName = new QName(namespaceURI, svcLocalPart);
    URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl);
    DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite();
    
    Service service = Service.create(wsdlUrl, serviceQName);
    ClientMetadataAddressingPortSEI port = service.getPort(ClientMetadataAddressingPortSEI.class);

    BindingProvider bindingProvider = (BindingProvider) port;
    SOAPBinding soapBinding = (SOAPBinding) bindingProvider.getBinding();
    assertFalse("Addressing is configured", soapBinding.isAddressingConfigured());
    assertFalse("Addressing is enabled", soapBinding.isAddressingEnabled());
    assertFalse("Addressing is required", soapBinding.isAddressingRequired());
    assertEquals("Addressing responses incorrect", Responses.ALL, soapBinding.getAddressingResponses());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:ClientMetadataAddressingFeatureTests.java


示例6: setAddressingResponses

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
public void setAddressingResponses(Responses responses) {
    addressingResponses = responses;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:4,代码来源:SOAPBinding.java


示例7: configureBindingFromMetadata

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Configure the binding from the Metadata for WebService Features.
 */
private void configureBindingFromMetadata() {
    // MTOM can be enabled either at the ServiceDescription level (via the WSDL binding type) or
    // at the EndpointDescription level via the binding type used to create a Dispatch.
    boolean enableMTOMFromMetadata = false;
    int mtomThreshold = 0;
    boolean isAddressingConfiguredViaMetadata = false;
    boolean enableRespectBindingdFromMetadata = false;
    boolean enableAddressingFromMetadata = false;
    boolean requireAddressingFromMetadata = false;
    Responses addressingResponses = null;
    
    // if we have an SEI for the port, then we'll use it in order to search for WebService Feature configuration
    if(endpointDesc.getEndpointInterfaceDescription() != null
            &&
            endpointDesc.getEndpointInterfaceDescription().getSEIClass() != null) {
        enableMTOMFromMetadata = endpointDesc.getServiceDescription().isMTOMEnabled(serviceDelegate, 
                                                           endpointDesc.getEndpointInterfaceDescription().getSEIClass());
        mtomThreshold = getMTOMThreshold(endpointDesc.getServiceDescription(), serviceDelegate,
                endpointDesc.getEndpointInterfaceDescription().getSEIClass());

        enableRespectBindingdFromMetadata = isRespectBindingEnabled(endpointDesc.getServiceDescription(), serviceDelegate,
                endpointDesc.getEndpointInterfaceDescription().getSEIClass());
        
        isAddressingConfiguredViaMetadata = isAddressingConfigured(endpointDesc.getServiceDescription(), serviceDelegate,
                endpointDesc.getEndpointInterfaceDescription().getSEIClass());
        if (isAddressingConfiguredViaMetadata) {
            enableAddressingFromMetadata = isAddressingEnabled(endpointDesc.getServiceDescription(), serviceDelegate,
                    endpointDesc.getEndpointInterfaceDescription().getSEIClass());
            requireAddressingFromMetadata = isAddressingRequired(endpointDesc.getServiceDescription(), serviceDelegate,
                    endpointDesc.getEndpointInterfaceDescription().getSEIClass());
            addressingResponses = getAddressingResponses(endpointDesc.getServiceDescription(), serviceDelegate,
                    endpointDesc.getEndpointInterfaceDescription().getSEIClass());
        }
       
        
    }
    else {
        enableMTOMFromMetadata = endpointDesc.getServiceDescription().isMTOMEnabled(serviceDelegate);
        // MTOM.Threshold, RespectBinding, and Addressing does not need to be set here based on the sparse composite 
        // (i.e. depolyment descriptor) since it can only be applied to a port injection (i.e. an SEI) using a DD.
    }
    if (!enableMTOMFromMetadata) {
        String bindingType = endpointDesc.getClientBindingID();
        enableMTOMFromMetadata = (bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || 
                                  bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING));
    }
    
    if (enableMTOMFromMetadata) {
        ((SOAPBinding) binding).setMTOMEnabled(true);
        ((SOAPBinding) binding).setMTOMThreshold(mtomThreshold);
    }
    
    if (enableRespectBindingdFromMetadata) {
        ((SOAPBinding) binding).setRespectBindingEnabled(true);
    }
    
    if (isAddressingConfiguredViaMetadata) {
        ((SOAPBinding) binding).setAddressingConfigured(true);
        ((SOAPBinding) binding).setAddressingEnabled(enableAddressingFromMetadata);
        ((SOAPBinding) binding).setAddressingRequired(requireAddressingFromMetadata);
        ((SOAPBinding) binding).setAddressingResponses(addressingResponses);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:67,代码来源:BindingProvider.java


示例8: getAddressingResponses

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
private Responses getAddressingResponses(ServiceDescription serviceDescription, ServiceDelegate serviceDelegateKey, 
        Class seiClass) {
    Responses responses = serviceDescription.getAddressingResponses(serviceDelegateKey, seiClass);
    return responses;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:6,代码来源:BindingProvider.java


示例9: testAddressingMetadata

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Validate correct behavior when addressing-related metadata is specified in a sparse composite, such as
 * would be used to represent configuration via a Deployment Descriptor.
 */
public void testAddressingMetadata() {
    Map<String, List<Annotation>> map = new HashMap();
    ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>();
    AddressingAnnot addressingFeature = new AddressingAnnot();
    addressingFeature.setEnabled(true);
    addressingFeature.setRequired(true);
    addressingFeature.setResponses(Responses.NON_ANONYMOUS);
    wsFeatures.add(addressingFeature);
    map.put(ProxyAddressingService.class.getName(), wsFeatures);
    DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite();
    serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map);
    ServiceDelegate.setServiceMetadata(serviceDBC);

    Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
    ProxyAddressingService proxy = svc.getPort(ProxyAddressingService.class);
    assertNotNull(proxy);
    
    proxy.doSomething("12345");
    
    TestClientInvocationController testController = getInvocationController();
    InvocationContext ic = testController.getInvocationContext();
    MessageContext request = ic.getRequestMessageContext();
    
    String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
    assertNotNull("Version not set", version);
    assertEquals("Wrong addressing version", Final.WSA_NAMESPACE, version);
    
    String required = (String) request.getProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
    assertNotNull("Required not set", required);
    assertEquals("Wrong addressing required", AddressingConstants.ADDRESSING_REQUIRED, required);


    Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
    assertNotNull("Disabled not set", disabled);
    assertFalse("Addressing disabled", disabled);

    String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME);
    assertNotNull("Responses not set", responses);
    assertEquals("Wrong responses value", AddressingConstants.WSAM_INVOCATION_PATTERN_ASYNCHRONOUS, responses);
    
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:46,代码来源:ProxyAddressingMetadataTest.java


示例10: testAddressingMetadataDisabled

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Validate correct behavior when addressing is disabled via addressing-related metadata specified in a sparse composite, such as
 * would be used to represent configuration via a Deployment Descriptor.
 */
public void testAddressingMetadataDisabled() {
    Map<String, List<Annotation>> map = new HashMap();
    ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>();
    AddressingAnnot addressingFeature = new AddressingAnnot();
    addressingFeature.setEnabled(false);
    addressingFeature.setRequired(true);
    addressingFeature.setResponses(Responses.NON_ANONYMOUS);
    wsFeatures.add(addressingFeature);
    map.put(ProxyAddressingService.class.getName(), wsFeatures);
    DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite();
    serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map);
    ServiceDelegate.setServiceMetadata(serviceDBC);

    Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
    ProxyAddressingService proxy = svc.getPort(ProxyAddressingService.class);
    assertNotNull(proxy);
    
    proxy.doSomething("12345");
    
    TestClientInvocationController testController = getInvocationController();
    InvocationContext ic = testController.getInvocationContext();
    MessageContext request = ic.getRequestMessageContext();
    
    // If addressing is not enabled the version should not be set
    String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
    assertNull("Version set", version);
    
    Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
    assertNotNull("Disabled not set", disabled);
    assertTrue("Addressing disabled", disabled);

    // Even though required=true above, per the addressing developers, they want to leave it set as unspecified when
    // addressing is not enabled.
    String required = (String) request.getProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
    assertNotNull("Required not set", required);
    assertEquals("Wrong addressing required", AddressingConstants.ADDRESSING_UNSPECIFIED, required);

    String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME);
    assertNotNull("Responses not set", responses);
    assertEquals("Wrong responses value", AddressingConstants.WSAM_INVOCATION_PATTERN_ASYNCHRONOUS, responses);
    
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:47,代码来源:ProxyAddressingMetadataTest.java


示例11: getAddressingResponses

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Return the type of responses required by Addressing.
 * Note that if addressing was not explicitly configured via metadata, this will return a default value.
 * @see #isAddressingConfigured()
 * @return AddressingFeature.Responses ENUM value indicating what type of addressing responses are required. 
 */
public Responses getAddressingResponses() {
    return addressingResponses;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:10,代码来源:SOAPBinding.java


示例12: getAddressingResponses

import javax.xml.ws.soap.AddressingFeature.Responses; //导入依赖的package包/类
/**
 * Answer the type of Addressing responses required by the service-requester.
 * Note that if addressing was not configured via metadata, then this method will return a default value,
 * otherwise it will return the value configured via metadata.
 * @see #isAddressingConfigured(Object, Class)
 * @param serviceDelegateKey The instance of the service delegate related to this service
 * @param seiClass The SEI for the port to retrieve the setting for.
 * @return AddressingFeature.Responses vale corresponding to the type of responses required by service-requester. 
 */
public abstract Responses getAddressingResponses(Object serviceDelegateKey, Class seiClass);
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:11,代码来源:ServiceDescription.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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