Package org.springframework.http.converter.xml

Examples of org.springframework.http.converter.xml.MarshallingHttpMessageConverter


        }
        catch (Exception ex) {
          throw new BeanCreationException(ex.getMessage(), ex);
        }

        MarshallingHttpMessageConverter messageConverter = new MarshallingHttpMessageConverter(marshaller);

        RootBeanDefinition adapterDef = new RootBeanDefinition(AnnotationMethodHandlerAdapter.class);
        adapterDef.getPropertyValues().add("messageConverters", messageConverter);
        wac.registerBeanDefinition("handlerAdapter", adapterDef);
        wac.refresh();
View Full Code Here


          marshaller.afterPropertiesSet();
        }
        catch (Exception ex) {
          throw new BeanCreationException(ex.getMessage(), ex);
        }
        MarshallingHttpMessageConverter messageConverter = new MarshallingHttpMessageConverter(marshaller);

        RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class);
        adapterDef.getPropertyValues().add("messageConverters", messageConverter);
        wac.registerBeanDefinition("handlerAdapter", adapterDef);
      }
View Full Code Here

public abstract class AbstractRestTemplateWithXmlFactoryBean extends AbstractRestTemplateFactoryBean {

    @Override
    protected MarshallingHttpMessageConverter marshallingHttpMessageConverter() {
        final MarshallingHttpMessageConverter marshallingHttpMessageConverter = new MarshallingHttpMessageConverter();
        marshallingHttpMessageConverter.setMarshaller(xstreamMarshaller());
        marshallingHttpMessageConverter.setUnmarshaller(xstreamMarshaller());

        return marshallingHttpMessageConverter;
    }
View Full Code Here

        }
        restTemplate = new RestTemplate(requestFactory);

        restTemplate.getMessageConverters().remove(5); // removing the Jaxb2RootElementHttpMessageConverter

        final MarshallingHttpMessageConverter marshallingHttpMessageConverter = marshallingHttpMessageConverter();
        if (marshallingHttpMessageConverter != null) {
            restTemplate.getMessageConverters().add(marshallingHttpMessageConverter);
        }
        restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
    }
View Full Code Here

        return xStreamMarshaller;
    }

    public MarshallingHttpMessageConverter marshallingHttpMessageConverter() {
        final MarshallingHttpMessageConverter marshallingHttpMessageConverter = new MarshallingHttpMessageConverter();
        final XStreamMarshaller xstreamMarshaller = xstreamMarshaller();
        marshallingHttpMessageConverter.setMarshaller(xstreamMarshaller);
        marshallingHttpMessageConverter.setUnmarshaller(xstreamMarshaller);

        return marshallingHttpMessageConverter;
    }
View Full Code Here

    }

    //

    final MarshallingHttpMessageConverter marshallingHttpMessageConverter() {
        final MarshallingHttpMessageConverter marshallingHttpMessageConverter = new MarshallingHttpMessageConverter();
        marshallingHttpMessageConverter.setMarshaller(xstreamMarshaller());
        marshallingHttpMessageConverter.setUnmarshaller(xstreamMarshaller());

        return marshallingHttpMessageConverter;
    }
View Full Code Here

        super.configureMessageConverters(messageConverters);
    }

    private HttpMessageConverter<Object> createXmlHttpMessageConverter() {
        final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter();

        final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller();
        xmlConverter.setMarshaller(xstreamMarshaller);
        xmlConverter.setUnmarshaller(xstreamMarshaller);

        return xmlConverter;
    }
View Full Code Here

    // UTIL

    private List<HttpMessageConverter<?>> getMessageConverters() {
        final List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();

        final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter();
        final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller();
        xmlConverter.setMarshaller(xstreamMarshaller);
        xmlConverter.setUnmarshaller(xstreamMarshaller);

        converters.add(xmlConverter);
        converters.add(new MappingJackson2HttpMessageConverter());

        return converters;
View Full Code Here

TOP

Related Classes of org.springframework.http.converter.xml.MarshallingHttpMessageConverter

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.