Package org.springframework.ws.server

Examples of org.springframework.ws.server.EndpointInvocationChain


     *
     * @see #setActorsOrRoles(String[])
     */
    @Override
    public EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception {
        EndpointInvocationChain delegateChain = delegate.getEndpoint(messageContext);
        if (delegateChain != null) {
            return new SoapEndpointInvocationChain(delegateChain.getEndpoint(), delegateChain.getInterceptors(),
                    actorsOrRoles, isUltimateReceiver);
        }
        else {
            return null;
        }
View Full Code Here


    @Test
    public void testGetEndpointMapping() throws Exception {
        String role = "http://www.springframework.org/spring-ws/role";
        endpointMapping.setActorOrRole(role);
        MessageContext context = new DefaultMessageContext(new MockWebServiceMessageFactory());
        EndpointInvocationChain delegateChain = new EndpointInvocationChain(new Object());
        expect(mock.getEndpoint(context)).andReturn(delegateChain);

        replay(mock);

        SoapEndpointInvocationChain resultChain = (SoapEndpointInvocationChain) endpointMapping.getEndpoint(context);
View Full Code Here

    @Test
    public void testMatch() throws Exception {
        SaajSoapMessage message = loadSaajMessage("200408/valid.xml");
        MessageContext messageContext = new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));

        EndpointInvocationChain endpoint = mapping.getEndpoint(messageContext);
        assertNotNull("No endpoint returned", endpoint);
        assertEquals("Invalid endpoint returned", endpoint1, endpoint.getEndpoint());
        EndpointInterceptor[] interceptors = endpoint.getInterceptors();
        assertEquals("Invalid amount of interceptors returned", 3, interceptors.length);
        assertTrue("Invalid first interceptor", interceptors[0] instanceof PayloadLoggingInterceptor);
        assertTrue("Invalid first interceptor", interceptors[1] instanceof AddressingEndpointInterceptor);
        assertTrue("Invalid first interceptor", interceptors[2] instanceof PayloadValidatingInterceptor);
    }
View Full Code Here

    @Test
    public void testNoMatch() throws Exception {
        SaajSoapMessage message = loadSaajMessage("200408/response-no-message-id.xml");
        MessageContext messageContext = new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));

        EndpointInvocationChain endpoint = mapping.getEndpoint(messageContext);
        assertNull("Endpoint returned", endpoint);
    }
View Full Code Here

    @Test
    public void mapping() throws Exception {
        MessageContext messageContext = createMessageContext();

        EndpointInvocationChain chain = mapping.getEndpoint(messageContext);
        assertNotNull("MethodEndpoint not registered", chain);
        MethodEndpoint expected = new MethodEndpoint(applicationContext.getBean("endpoint"), "doIt");
        assertEquals("Invalid endpoint registered", expected, chain.getEndpoint());
      assertEquals("No smart interceptors registered", 2, chain.getInterceptors().length);
      assertTrue(chain.getInterceptors()[0] instanceof AddressingEndpointInterceptor);
      assertTrue(chain.getInterceptors()[1] instanceof MyInterceptor);
    }
View Full Code Here

                return null;
            }
        };
        mapping.setDefaultEndpoint(defaultEndpoint);

        EndpointInvocationChain result = mapping.getEndpoint(messageContext);
        assertNotNull("No EndpointInvocatioChain returned", result);
        assertEquals("Default Endpoint not returned", defaultEndpoint, result.getEndpoint());
    }
View Full Code Here

                assertEquals("Invalid request passed", messageContext, givenRequest);
                return endpoint;
            }
        };

        EndpointInvocationChain result = mapping.getEndpoint(messageContext);
        assertNotNull("No EndpointInvocationChain returned", result);
        assertEquals("Unexpected Endpoint returned", endpoint, result.getEndpoint());
    }
View Full Code Here

                return endpoint;
            }
        };

        mapping.setInterceptors(new EndpointInterceptor[]{interceptor});
        EndpointInvocationChain result = mapping.getEndpoint(messageContext);
        assertEquals("Unexpected amount of EndpointInterceptors returned", 1, result.getInterceptors().length);
        assertEquals("Unexpected EndpointInterceptor returned", interceptor, result.getInterceptors()[0]);
    }
View Full Code Here

            }
        };
        mapping.setApplicationContext(applicationContext);
        mapping.setInterceptors(new EndpointInterceptor[]{interceptor});
       
        EndpointInvocationChain result = mapping.getEndpoint(messageContext);
        assertEquals("Unexpected amount of EndpointInterceptors returned", 2, result.getInterceptors().length);
        assertEquals("Unexpected EndpointInterceptor returned", interceptor, result.getInterceptors()[0]);
        assertTrue("Unexpected EndpointInterceptor returned",
                result.getInterceptors()[1] instanceof MySmartEndpointInterceptor);
    }
View Full Code Here

                return "endpoint";
            }
        };
        mapping.setApplicationContext(applicationContext);

        EndpointInvocationChain result = mapping.getEndpoint(messageContext);
        assertNotNull("No endpoint returned", result);
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.server.EndpointInvocationChain

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.