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


Java AddressingConstants类代码示例

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


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

示例1: handleAddressing

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void handleAddressing(UnifiedEndpoint uep, MessageContext msgContext) {
    String addressingVersion = uep.getAddressingVersion();
    if (uep.isAddressingEnabled()) {
        if (addressingVersion != null
            && UnifiedEndpointConstants.ADDRESSING_VERSION_SUBMISSION.equals(addressingVersion)) {
            msgContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
                                   AddressingConstants.Submission.WSA_NAMESPACE);
        } else if (addressingVersion != null
                   && UnifiedEndpointConstants.ADDRESSING_VERSION_FINAL.equals(addressingVersion)) {
            msgContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
                                   AddressingConstants.Final.WSA_NAMESPACE);
        }

        msgContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);

        //Adding ReplyTo address
        if (uep.getReplyToAddress() != null) {
            msgContext.getOptions().setReplyTo(new EndpointReference(uep.getReplyToAddress().toString()));
        }
    } else {
        msgContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:24,代码来源:UnifiedEndpointHandler.java

示例2: testWithoutUsingAddressing

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testWithoutUsingAddressing() {
    File testResourceFile = new File(wsdlLocation);
    try {
        WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
                new FileInputStream(testResourceFile));
        AxisService axisService = builder.populateService();
        String addressingRequired = AddressingHelper
                .getAddressingRequirementParemeterValue(axisService);
        assertEquals("Unexpected addressingRequirementParameter value: "
                + addressingRequired,
                AddressingConstants.ADDRESSING_UNSPECIFIED,
                addressingRequired);
    } catch (Exception e) {
        System.out.println("Error in WSDL : " + testResourceFile.getName());
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:WSDL11ToAxisServiceBuilderTest.java

示例3: testUsingAddressing

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressing() {
    wsdlLocation = System.getProperty("basedir", ".") + "/"
            + "test-resources/wsdl/UsingAddressing.wsdl";
    File testResourceFile = new File(wsdlLocation);
    try {
        WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
                new FileInputStream(testResourceFile));
        AxisService axisService = builder.populateService();
        String addressingRequired = AddressingHelper
                .getAddressingRequirementParemeterValue(axisService);
        assertEquals("Unexpected addressingRequirementParameter value: "
                + addressingRequired,
                AddressingConstants.ADDRESSING_OPTIONAL, addressingRequired);
    } catch (Exception e) {
        System.out.println("Error in WSDL : " + testResourceFile.getName());
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:WSDL11ToAxisServiceBuilderTest.java

示例4: testUsingAddressingOptional

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingOptional() {
    wsdlLocation = System.getProperty("basedir", ".") + "/"
            + "test-resources/wsdl/UsingAddressingOptional.wsdl";
    File testResourceFile = new File(wsdlLocation);
    try {
        WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
                new FileInputStream(testResourceFile));
        AxisService axisService = builder.populateService();
        String addressingRequired = AddressingHelper
                .getAddressingRequirementParemeterValue(axisService);
        assertEquals("Unexpected addressingRequirementParameter value: "
                + addressingRequired,
                AddressingConstants.ADDRESSING_OPTIONAL, addressingRequired);
    } catch (Exception e) {
        System.out.println("Error in WSDL : " + testResourceFile.getName());
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:WSDL11ToAxisServiceBuilderTest.java

示例5: testUsingAddressingRequired

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingRequired() {
    wsdlLocation = System.getProperty("basedir", ".") + "/"
            + "test-resources/wsdl/UsingAddressingRequired.wsdl";
    File testResourceFile = new File(wsdlLocation);
    try {
        WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
                new FileInputStream(testResourceFile));
        AxisService axisService = builder.populateService();
        String addressingRequired = AddressingHelper
                .getAddressingRequirementParemeterValue(axisService);
        assertEquals("Unexpected addressingRequirementParameter value: "
                + addressingRequired,
                AddressingConstants.ADDRESSING_REQUIRED, addressingRequired);
    } catch (Exception e) {
        System.out.println("Error in WSDL : " + testResourceFile.getName());
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:WSDL11ToAxisServiceBuilderTest.java

示例6: processMessageID

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void processMessageID() {
    String messageID = messageContextOptions.getMessageId();
    
    //Check whether we want to force a message id to be sent.
    if (messageID == null && includeOptionalHeaders) {
        messageID = UIDGenerator.generateURNString();
        messageContextOptions.setMessageId(messageID);
    }
    
    if (messageID != null && !isAddressingHeaderAlreadyAvailable(WSA_MESSAGE_ID, false))
    {//optional
    	ArrayList attributes = (ArrayList)messageContext.getLocalProperty(
                AddressingConstants.MESSAGEID_ATTRIBUTES);
        createSOAPHeaderBlock(messageID, WSA_MESSAGE_ID, attributes);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:AddressingOutHandler.java

示例7: assertMessageIDHasExtensibilityAttribute

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void assertMessageIDHasExtensibilityAttribute(MessageContext mc) {
    boolean attributeFound = false;
    ArrayList attributes = (ArrayList)mc.getProperty(AddressingConstants.MESSAGEID_ATTRIBUTES);
    if (attributes != null) {
        Iterator iter = attributes.iterator();
        while (iter.hasNext()) {
            OMAttribute oa = (OMAttribute)iter.next();
            if (oa.getLocalName().equals("AttrExt")) {
                attributeFound = true;
                assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
                             "123456789");
            }
        }
    }
    assertTrue("Extensibility attribute not found on MessageID", attributeFound);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:AddressingInHandlerTestBase.java

示例8: testMessageWithOmittedReplyTo

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testMessageWithOmittedReplyTo() {
    try {
        Options options = testMessageWithOmittedHeaders("noReplyTo");
        EndpointReference epr = options.getReplyTo();
        String address = epr.getAddress();

        assertEquals("The address of the ReplyTo endpoint reference is not the none URI.",
                     AddressingConstants.Final.WSA_NONE_URI, address);
    }
    catch (AxisFault af) {
        af.printStackTrace();
        log.error(af.getMessage());
        fail("An unexpected AxisFault was thrown due to a missing ReplyTo header.");
    }
    catch (Exception e) {
        e.printStackTrace();
        log.error(e.getMessage());
        fail(" An Exception has occured " + e.getMessage());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:AddressingSubmissionInHandlerTest.java

示例9: testMessageWithOmittedReplyTo

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testMessageWithOmittedReplyTo() {
    try {
        Options options = testMessageWithOmittedHeaders("noReplyTo");
        EndpointReference epr = options.getReplyTo();
        String address = epr.getAddress();

        assertEquals("The address of the ReplyTo endpoint reference is not the anonymous URI.",
                     AddressingConstants.Final.WSA_ANONYMOUS_URL, address);
    }
    catch (AxisFault af) {
        af.printStackTrace();
        log.error(af.getMessage());
        fail("An unexpected AxisFault was thrown due to a missing ReplyTo header.");
    }
    catch (Exception e) {
        e.printStackTrace();
        log.error(e.getMessage());
        fail(" An Exception has occured " + e.getMessage());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:AddressingFinalInHandlerTest.java

示例10: testMessageWithOmittedTo

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testMessageWithOmittedTo() {
    try {
        Options options = testMessageWithOmittedHeaders("noTo");
        EndpointReference epr = options.getTo();
        String address = epr.getAddress();

        assertEquals("The address of the To endpoint reference is not the anonymous URI.",
                     AddressingConstants.Final.WSA_ANONYMOUS_URL, address);
    }
    catch (AxisFault af) {
        af.printStackTrace();
        log.error(af.getMessage());
        fail("An unexpected AxisFault was thrown due to a missing To header.");
    }
    catch (Exception e) {
        e.printStackTrace();
        log.error(e.getMessage());
        fail(" An Exception has occured " + e.getMessage());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:AddressingFinalInHandlerTest.java

示例11: testWithoutUsingAddressing

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testWithoutUsingAddressing() {
    String wsdlLocation = getClass().getResource("/wsdl/Test.wsdl").toExternalForm();
    try {
        Service svc = Service.create(new URL(wsdlLocation), serviceQName);
        Sample s = svc.getPort(portQName, Sample.class);

        org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;

        Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
                AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        assertTrue("Unexpected disableAddressingForOutMessages value: "
                + addressingDisabled, addressingDisabled);
    } catch (MalformedURLException e) {
        System.out.println("Error in WSDL : " + wsdlLocation);
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:UsingAddressingTests.java

示例12: testUsingAddressing

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressing() {
    String wsdlLocation = getClass().getResource("/wsdl/UsingAddressing.wsdl").toExternalForm();
    try {
        Service svc = Service.create(new URL(wsdlLocation), serviceQName);
        Sample s = svc.getPort(portQName, Sample.class);

        org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;

        Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
                AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        // Do NOT change this to assertFalse since this allows us to
        // differentiate from addressing being enabled by JAX-WS 2.1
        // features and annotations which override the WSDL.
        assertNull("Unexpected disableAddressingForOutMessages value: "
                + addressingDisabled, addressingDisabled);
    } catch (MalformedURLException e) {
        System.out.println("Error in WSDL : " + wsdlLocation);
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UsingAddressingTests.java

示例13: testUsingAddressingOptional

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingOptional() {
    String wsdlLocation = getClass().getResource("/wsdl/UsingAddressingOptional.wsdl").toExternalForm();
    try {
        Service svc = Service.create(new URL(wsdlLocation), serviceQName);
        Sample s = svc.getPort(portQName, Sample.class);

        org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;

        Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
                AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        // Do NOT change this to assertFalse since this allows us to
        // differentiate from addressing being enabled by JAX-WS 2.1
        // features and annotations which override the WSDL.
        assertNull("Unexpected disableAddressingForOutMessages value: "
                + addressingDisabled, addressingDisabled);
    } catch (MalformedURLException e) {
        System.out.println("Error in WSDL : " + wsdlLocation);
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UsingAddressingTests.java

示例14: testUsingAddressingRequired

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingRequired() {
    String wsdlLocation = getClass().getResource("/wsdl/UsingAddressingRequired.wsdl").toExternalForm();
    try {
        Service svc = Service.create(new URL(wsdlLocation), serviceQName);
        Sample s = svc.getPort(portQName, Sample.class);

        org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;

        Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
                AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        // Do NOT change this to assertFalse since this allows us to
        // differentiate from addressing being enabled by JAX-WS 2.1
        // features and annotations which override the WSDL.
        assertNull("Unexpected disableAddressingForOutMessages value: "
                + addressingDisabled, addressingDisabled);
    } catch (MalformedURLException e) {
        System.out.println("Error in WSDL : " + wsdlLocation);
        System.out.println("Exception: " + e.toString());
        fail("Caught exception " + e.toString());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UsingAddressingTests.java

示例15: testAddressingNoMetadata

import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
/**
 * Validate when no addressing-related metadata is set.
 */
public void testAddressingNoMetadata() {
    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);
    Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
    String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME);
    String required = (String) request.getProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
    
    assertNull(version);
    assertTrue(disabled);
    assertNull(responses);
    assertNull(required);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:ProxyAddressingMetadataTest.java


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