Package org.springframework.ws.server.endpoint.adapter

Examples of org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter


    List<MethodReturnValueHandler> returnValueHandlers =
        new ArrayList<MethodReturnValueHandler>();
    addReturnValueHandlers(returnValueHandlers);

    DefaultMethodEndpointAdapter adapter = new DefaultMethodEndpointAdapter();
    adapter.setCustomMethodArgumentResolvers(argumentResolvers);
    adapter.setCustomMethodReturnValueHandlers(returnValueHandlers);

    return adapter;
  }
View Full Code Here


        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage request = messageFactory.createMessage();
        request.getSOAPBody().addBodyElement(QName.valueOf("{http://springframework.org/spring-ws}Request"));
        MessageContext messageContext =
                new DefaultMessageContext(new SaajSoapMessage(request), new SaajSoapMessageFactory(messageFactory));
        DefaultMethodEndpointAdapter adapter = new DefaultMethodEndpointAdapter();
        adapter.afterPropertiesSet();

        MessageDispatcher messageDispatcher = new SoapMessageDispatcher();
        messageDispatcher.setApplicationContext(applicationContext);
        messageDispatcher.setEndpointMappings(Collections.<EndpointMapping>singletonList(mapping));
        messageDispatcher.setEndpointAdapters(Collections.<EndpointAdapter>singletonList(adapter));
View Full Code Here

    @Test
    public void endpointAdapters() {
        Map<String, EndpointAdapter> result =
                applicationContext.getBeansOfType(EndpointAdapter.class);
        assertEquals("invalid amount of endpoint mappings found", 1, result.size());
        DefaultMethodEndpointAdapter endpointAdapter = (DefaultMethodEndpointAdapter) result.values().iterator().next();

        List<MethodArgumentResolver> argumentResolvers = endpointAdapter.getMethodArgumentResolvers();
        assertTrue("No argumentResolvers created", !argumentResolvers.isEmpty());
        assertContainsInstanceOf(argumentResolvers, MessageContextMethodArgumentResolver.class);
        assertContainsInstanceOf(argumentResolvers, XPathParamMethodArgumentResolver.class);
        assertContainsInstanceOf(argumentResolvers, SoapMethodArgumentResolver.class);
        assertContainsInstanceOf(argumentResolvers, SoapHeaderElementMethodArgumentResolver.class);
        assertContainsInstanceOf(argumentResolvers, DomPayloadMethodProcessor.class);
        assertContainsInstanceOf(argumentResolvers, SourcePayloadMethodProcessor.class);
        assertContainsInstanceOf(argumentResolvers, Dom4jPayloadMethodProcessor.class);
        assertContainsInstanceOf(argumentResolvers, XmlRootElementPayloadMethodProcessor.class);
        assertContainsInstanceOf(argumentResolvers, JaxbElementPayloadMethodProcessor.class);
        assertContainsInstanceOf(argumentResolvers, JDomPayloadMethodProcessor.class);
        assertContainsInstanceOf(argumentResolvers, StaxPayloadMethodArgumentResolver.class);
        assertContainsInstanceOf(argumentResolvers, XomPayloadMethodProcessor.class);

        List<MethodReturnValueHandler> returnValueHandlers = endpointAdapter.getMethodReturnValueHandlers();
        assertTrue("No returnValueHandlers created", !returnValueHandlers.isEmpty());
        assertContainsInstanceOf(returnValueHandlers, DomPayloadMethodProcessor.class);
        assertContainsInstanceOf(returnValueHandlers, SourcePayloadMethodProcessor.class);
        assertContainsInstanceOf(returnValueHandlers, Dom4jPayloadMethodProcessor.class);
        assertContainsInstanceOf(returnValueHandlers, XmlRootElementPayloadMethodProcessor.class);
View Full Code Here

    assertTrue(interceptors[0] instanceof MyInterceptor);
  }

  @Test
  public void argumentResolvers() {
    DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);

    List<MethodArgumentResolver> argumentResolvers =
        endpointAdapter.getCustomMethodArgumentResolvers();
    assertEquals(1, argumentResolvers.size());
    assertTrue(argumentResolvers.get(0) instanceof MyMethodArgumentResolver);

    argumentResolvers = endpointAdapter.getMethodArgumentResolvers();
    assertFalse(argumentResolvers.isEmpty());
  }
View Full Code Here

    assertFalse(argumentResolvers.isEmpty());
  }

  @Test
  public void returnValueHandlers() {
    DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);

    List<MethodReturnValueHandler> returnValueHandlers =
        endpointAdapter.getCustomMethodReturnValueHandlers();
    assertEquals(1, returnValueHandlers.size());
    assertTrue(returnValueHandlers.get(0) instanceof MyReturnValueHandler);

    returnValueHandlers = endpointAdapter.getMethodReturnValueHandlers();
    assertFalse(returnValueHandlers.isEmpty());
  }
View Full Code Here

    assertTrue(interceptors[0] instanceof MyInterceptor);
  }

  @Test
  public void defaultMethodEndpointAdapter() {
    DefaultMethodEndpointAdapter endpointAdapter =
        this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);
    assertNotNull(endpointAdapter);

    assertTrue(endpointAdapter instanceof MyDefaultMethodEndpointAdapter);
  }
View Full Code Here

  }

  @Test
  public void defaultMethodEndpointAdapter() throws Exception {

    DefaultMethodEndpointAdapter adapter =
        this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);

    assertFalse(adapter.getMethodArgumentResolvers().isEmpty());
    assertFalse(adapter.getMethodReturnValueHandlers().isEmpty());
  }
View Full Code Here

TOP

Related Classes of org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter

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.