Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.RolePlayer


          OMElement roleElement = (OMElement) iterator.next();
          roles.add(roleElement.getText());
        }
        final List unmodifiableRoles = Collections.unmodifiableList(roles);
        try{
          RolePlayer rolePlayer = new RolePlayer(){
            public List getRoles() {
              return unmodifiableRoles;
            }
            public boolean isUltimateDestination() {
              return isUltimateReceiever;
View Full Code Here


     * The JAXWS Spec, section 10, says roles can be set on the SOAP binding.  Verify that a
     * mustUnderstand header which is not processed for a role added by the SOAPBinding causes
     * a Not Understood fault
     */
    public void testRoleAddedToSoapBinding() {
        RolePlayer rolePlayer = new UltimateDestinationRoles();
       
        MessageContext mscCtx11 = createMessageContext(soap11Factory);
        // Note that since this role is UltimateReceiver, all unprocessed headers will be set
        // on the message context
        setUnprocessedHeaders(mscCtx11, rolePlayer);
View Full Code Here

    /**
     * A mustUnderstand header for a role not being acted in should NOT cause a notUnderstood
     * fault.
     */
    public void testRoleNotActingIn() {
        RolePlayer rolePlayer = new UltimateDestinationRoles();
       
        MessageContext mscCtx11 = createMessageContext(soap11Factory);
        // Note that since this role is UltimateReceiver, all unprocessed headers will be set
        // on the message context
        setUnprocessedHeaders(mscCtx11, rolePlayer);
View Full Code Here

     * Test mustUnderstand processing for Ultimate Receiver with an understood header list
     * passed to the mustUnderstand checking
     */
    public void testUltimateReceiverRoles() {
       
        RolePlayer rolePlayer = new UltimateDestinationRoles();
        MessageContext mscCtx11 = createMessageContext(soap11Factory);
        setUnprocessedHeaders(mscCtx11, rolePlayer);
        // Indicate we understand (e.g. via handlers) all the headers.
        List<QName> understoodHeaders = new ArrayList<QName>();
        understoodHeaders.add(new QName(namespace, header_ultimateReceiver));
View Full Code Here

     * Verify that an Ultimate Receiver with no roles only yields the header with no role specified
     * as unprocessed and that passing a list of understood headers including just that one causes
     * the mustUnderstand checks to pass.
     */
    public void testUltimateReceiver() {
        RolePlayer rolePlayer = new UltimateDestinationNoRoles();
        MessageContext msgCtx = createMessageContext(soap11Factory);
        // Indicate the must understand header without an explicit role will be understood.
        // The other headers, with explicit roles, should not cause an error.
        setUnprocessedHeaders(msgCtx, rolePlayer);
        List<QName> understoodHeaders = new ArrayList<QName>();
View Full Code Here

    /**
     * Test mustUnderstand processing for Ultimate Receiver without additional understood headers
     * being passed to the checker.  This should cause a notUnderstood fault
     */
    public void testUltimateReceiverNoRoles() {
        RolePlayer rolePlayer = new UltimateDestinationNoRoles();

        MessageContext messageContext11 = createMessageContext(soap11Factory);
        setUnprocessedHeaders(messageContext11, rolePlayer);
        try {
            HandlerUtils.checkMustUnderstand(messageContext11, null, null);
View Full Code Here

    /**
     * Test a RolePlayer that is not an ultimate receiver and does not act in any roles
     * corresponding to headers.  There should be no faults cause by the mustUnderstand headers
     */
    public void testNotUltimateReceiverNoRoles() {
        RolePlayer rolePlayer = new NotUltimateDestinationNoRoles();
       
        MessageContext msgCtx11 = createMessageContext(soap11Factory);
        setUnprocessedHeaders(msgCtx11, rolePlayer);
        try {
            HandlerUtils.checkMustUnderstand(msgCtx11, null, null);
View Full Code Here

     * Test that a RolePlayer with no roles doesn't cause any problems in the mustUnderstand
     * checking.
     */
    public void testHandlerResolverEmptyRolesPlayed() {
       
        RolePlayer rolePlayer = new UltimateDestinationRoles();
        MessageContext msgCtx11 = createMessageContext(soap11Factory);
        setUnprocessedHeaders(msgCtx11, rolePlayer);
        // Indicate we understand (e.g. via handlers) all the headers.
        List<QName> understoodHeaders = new ArrayList<QName>();
        understoodHeaders.add(new QName(namespace, header_ultimateReceiver));
View Full Code Here

          OMElement roleElement = (OMElement) iterator.next();
          roles.add(roleElement.getText());
        }
        final List unmodifiableRoles = Collections.unmodifiableList(roles);
        try{
          RolePlayer rolePlayer = new RolePlayer(){
            public List getRoles() {
              return unmodifiableRoles;
            }
            public boolean isUltimateDestination() {
              return isUltimateReceiever;
View Full Code Here

    protected void runTest() throws Throwable {
        SOAPEnvelope env = getTestMessage("roleMessage.xml");
        SOAPHeader soapHeader = env.getHeader();

        String roles [] = { CUSTOM_ROLE };
        RolePlayer rp = new MyRolePlayer(true, roles);

        Iterator headers = soapHeader.getHeadersToProcess(rp);
        assertTrue("No headers!", headers.hasNext());

        int numHeaders = 0;
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.RolePlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.