Package org.springframework.ws.server.endpoint

Examples of org.springframework.ws.server.endpoint.MethodEndpoint


    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


            if (method.isSynthetic() || method.getDeclaringClass().equals(Object.class)) {
                continue;
            }
            URI action = getActionForMethod(method);
            if (action != null) {
                registerEndpoint(action, new MethodEndpoint(endpoint, method));
            }
        }
    }
View Full Code Here

     * @param endpoint the method endpoint to return the address for
     * @return the endpoint address; or {@code null} to ignore the destination property
     */
    @Override
    protected URI getEndpointAddress(Object endpoint) {
        MethodEndpoint methodEndpoint = (MethodEndpoint) endpoint;
        Class<?> endpointClass = methodEndpoint.getMethod().getDeclaringClass();
        Address address = AnnotationUtils.findAnnotation(endpointClass, Address.class);
        if (address != null && StringUtils.hasText(address.value())) {
            return getActionUri(address.value(), methodEndpoint);
        }
        else {
View Full Code Here

        }
    }

    @Override
    protected URI getResponseAction(Object endpoint, MessageAddressingProperties map) {
        MethodEndpoint methodEndpoint = (MethodEndpoint) endpoint;
        Action action = methodEndpoint.getMethod().getAnnotation(Action.class);
        if (action != null && StringUtils.hasText(action.output())) {
            return getActionUri(action.output(), methodEndpoint);
        }
        else {
            return super.getResponseAction(endpoint, map);
View Full Code Here

        }
    }

    @Override
    protected URI getFaultAction(Object endpoint, MessageAddressingProperties map) {
        MethodEndpoint methodEndpoint = (MethodEndpoint) endpoint;
        Action action = methodEndpoint.getMethod().getAnnotation(Action.class);
        if (action != null && StringUtils.hasText(action.fault())) {
            return getActionUri(action.fault(), methodEndpoint);
        }
        else {
            return super.getResponseAction(endpoint, map);
View Full Code Here

    @Autowired
    private ApplicationContext applicationContext;

    @Test
    public void registration() throws NoSuchMethodException {
        MethodEndpoint bridgedMethod = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
        assertNotNull("bridged method endpoint not registered", bridgedMethod);
        Method doIt = B.class.getMethod("doIt");
        MethodEndpoint expected = new MethodEndpoint("bridgedMethodEndpoint", applicationContext, doIt);
        assertEquals("Invalid endpoint registered", expected, bridgedMethod);
    }
View Full Code Here

    @Autowired
    private ApplicationContext applicationContext;

    @Test
    public void registrationSingle() throws NoSuchMethodException {
        MethodEndpoint endpoint = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
        assertNotNull("MethodEndpoint not registered", endpoint);
        Method doIt = MyEndpoint.class.getMethod("doIt", Source.class);
        MethodEndpoint expected = new MethodEndpoint("endpoint", applicationContext, doIt);
        assertEquals("Invalid endpoint registered", expected, endpoint);
    }
View Full Code Here

    }

    @Test
    public void registrationMultiple() throws NoSuchMethodException {
      Method doItMultiple = MyEndpoint.class.getMethod("doItMultiple");
      MethodEndpoint expected = new MethodEndpoint("endpoint", applicationContext, doItMultiple);

        MethodEndpoint endpoint = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request1"));
        assertNotNull("MethodEndpoint not registered", endpoint);
        assertEquals("Invalid endpoint registered", expected, endpoint);

      endpoint = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request2"));
        assertNotNull("MethodEndpoint not registered", endpoint);
View Full Code Here

    }

    @Test
    public void registrationRepeatable() throws NoSuchMethodException {
      Method doItMultiple = MyEndpoint.class.getMethod("doItRepeatable");
      MethodEndpoint expected = new MethodEndpoint("endpoint", applicationContext, doItMultiple);

        MethodEndpoint endpoint = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request3"));
        assertNotNull("MethodEndpoint not registered", endpoint);
        assertEquals("Invalid endpoint registered", expected, endpoint);

      endpoint = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request4"));
        assertNotNull("MethodEndpoint not registered", endpoint);
View Full Code Here

    @Autowired
    private ApplicationContext applicationContext;

    @Test
    public void registration() throws NoSuchMethodException {
        MethodEndpoint cglibProxy = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
        assertNotNull("cg lib proxy endpoint not registered", cglibProxy);
        Method doIt = MyEndpoint.class.getMethod("doIt", Source.class);
        MethodEndpoint expected = new MethodEndpoint("cgLibProxyEndpoint", applicationContext, doIt);
        assertEquals("Invalid endpoint registered", expected, cglibProxy);
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.server.endpoint.MethodEndpoint

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.