Example usage for org.springframework.oxm.jaxb Jaxb2Marshaller Jaxb2Marshaller

List of usage examples for org.springframework.oxm.jaxb Jaxb2Marshaller Jaxb2Marshaller

Introduction

In this page you can find the example usage for org.springframework.oxm.jaxb Jaxb2Marshaller Jaxb2Marshaller.

Prototype

Jaxb2Marshaller

Source Link

Usage

From source file:com.devnexus.ting.web.config.PersistenceConfig.java

@Bean
public Jaxb2Marshaller jaxbMarshaller() {
    Jaxb2Marshaller jaxbMarshaller = new Jaxb2Marshaller();
    jaxbMarshaller.setClassesToBeBound(com.devnexus.ting.model.Evaluation.class,
            com.devnexus.ting.model.EvaluationList.class, com.devnexus.ting.model.Event.class,
            com.devnexus.ting.model.Presentation.class, com.devnexus.ting.model.PresentationList.class,
            com.devnexus.ting.model.Room.class, com.devnexus.ting.model.RoomList.class,
            com.devnexus.ting.model.ScheduleItem.class, com.devnexus.ting.model.ScheduleItemList.class,
            com.devnexus.ting.model.Sponsor.class, com.devnexus.ting.model.Speaker.class,
            com.devnexus.ting.model.SpeakerList.class, com.devnexus.ting.model.ScheduleItemType.class,
            com.devnexus.ting.model.CfpSubmission.class, com.devnexus.ting.model.CfpSubmissionList.class);
    return jaxbMarshaller;
}

From source file:org.ow2.petals.cloud.vacation.web.VacationWebUiApplication.java

@Bean
public Jaxb2Marshaller marshaller() {
    final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPaths("org.ow2.petals.components.activiti.generic._1",
            "org.ow2.petals.samples.se_bpmn.vacationrequest", "org.ow2.petals.samples.se_bpmn.vacationservice");
    return marshaller;
}

From source file:py.una.pol.karaku.test.test.services.EndpointExceptionResolverTest.java

/**
 * Test method for/* w w w  .  j a  v a  2s.  co m*/
 * {@link py.una.pol.karaku.services.server.EndpointExceptionResolver#customizeFault(java.lang.Object, java.lang.Exception, org.springframework.ws.soap.SoapFault)}
 * .
 * 
 * @throws SecurityException
 * @throws NoSuchMethodException
 */
@Test
public void testCustomizeFaultObjectExceptionSoapFault() throws Exception {

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(HTTPExceptionDTO.class);

    EndpointExceptionResolver eer = new EndpointExceptionResolver();
    eer.setMarshaller(marshaller);

    Method m = Endpoint.class.getMethod("call", String.class);

    MethodEndpoint me = new MethodEndpoint(new Endpoint(), m);

    Fault f = new Fault();
    eer.customizeFault(me, new HTTPException("1", "code"), f);

    StringResult result = f.getFaultDetail().getResult();

    // @formatter:off
    String expectedResult = "" + "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
            + "<ns2:HTTPException xmlns:ns2=\"http://sigh.med.una.py/2013/schemas/base\">" + "<code>1</code>"
            + "<summary>code</summary>" + "</ns2:HTTPException>";
    // @formatter:on
    assertEquals(result.toString(), expectedResult);

}

From source file:org.bremersee.common.web.client.ResponseErrorHandlerImpl.java

/**
 * Default constructor./*from w  w w. j  a v  a  2 s .  co  m*/
 */
public ResponseErrorHandlerImpl() {
    Jaxb2Marshaller m = new Jaxb2Marshaller();
    m.setContextPath(ThrowableMessageDto.class.getPackage().getName());
    unmarshaller = m;
    objectMapper = new ObjectMapper();
    // see http://wiki.fasterxml.com/JacksonJAXBAnnotations
    AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
    AnnotationIntrospector secondary = new JaxbAnnotationIntrospector(TypeFactory.defaultInstance());
    AnnotationIntrospectorPair pair = new AnnotationIntrospectorPair(primary, secondary);
    objectMapper.setAnnotationIntrospector(pair);
}

From source file:com.work.petclinic.config.WebMvcConfig.java

@Bean(name = "marshallingXmlViewResolver")
public ViewResolver getMarshallingXmlViewResolver() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class[] { Vets.class });
    return new XmlViewResolver(marshaller);
}

From source file:siia.booking.domain.trip.LegQuoteMarshallingTest.java

@Before
public void setUp() {
    this.marshaller = new Jaxb2Marshaller();
    this.marshaller.setClassesToBeBound(new Class[] { LegQuoteCommand.class });
    this.exampleLegQuote = new LegQuoteCommand(new Leg(startLegDateTime, endLegDateTime, london, buenosAires));

    CarCriteria carCriteria = new CarCriteria();
    carCriteria.setCarType(CarType.Compact);
    this.exampleLegQuote.setCarCriteria(carCriteria);

    FlightCriteria flightCriteria = new FlightCriteria();
    flightCriteria.setRequiredSeatClass(FlightSeatClass.Business);
    this.exampleLegQuote.setFlightCriteria(flightCriteria);

    HotelCriteria hotelCriteria = new HotelCriteria();
    hotelCriteria.setRoomType(RoomType.Double);
    this.exampleLegQuote.setHotelCriteria(hotelCriteria);
}

From source file:com.devnexus.ting.config.PersistenceConfig.java

@Bean
public Jaxb2Marshaller jaxbMarshaller() {
    Jaxb2Marshaller jaxbMarshaller = new Jaxb2Marshaller();
    jaxbMarshaller.setClassesToBeBound(/*  ww  w  .jav a 2 s . co m*/

            com.devnexus.ting.model.Evaluation.class, com.devnexus.ting.model.EvaluationList.class,
            com.devnexus.ting.model.Event.class, com.devnexus.ting.model.Presentation.class,
            com.devnexus.ting.model.PresentationList.class, com.devnexus.ting.model.Room.class,
            com.devnexus.ting.model.RoomList.class, com.devnexus.ting.model.ScheduleItem.class,
            com.devnexus.ting.model.ScheduleItemList.class, com.devnexus.ting.model.Sponsor.class,
            com.devnexus.ting.model.Speaker.class, com.devnexus.ting.model.SpeakerList.class,
            com.devnexus.ting.model.ScheduleItemType.class, com.devnexus.ting.model.CfpSubmission.class,
            com.devnexus.ting.model.CfpSubmissionSpeaker.class, com.devnexus.ting.model.CfpSubmissionList.class,
            com.devnexus.ting.model.TicketGroup.class);
    return jaxbMarshaller;
}

From source file:io.getlime.push.configuration.PowerAuthWebServiceConfiguration.java

/**
 * Marshaller for PowerAuth SOAP service communication.
 *
 * @return JAXB marshaller with correctly configured context path.
 */// w w  w . j  a va2  s  .c  o  m
@Bean
public Jaxb2Marshaller marshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPath("io.getlime.powerauth.soap");
    return marshaller;
}

From source file:org.osgp.adapter.protocol.dlms.application.config.JasperWirelessConfig.java

@Bean
public Jaxb2Marshaller marshaller() {
    final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPaths("com.jasperwireless.api.ws.service");
    return marshaller;
}

From source file:org.bremersee.common.spring.autoconfigure.WebMvcExceptionResolver.java

public WebMvcExceptionResolver() {
    defaultExceptionMapper = new ThrowableToThrowableDtoMapper();
    Jaxb2Marshaller m = new Jaxb2Marshaller();
    m.setContextPath(ThrowableDto.class.getPackage().getName());
    marshaller = m;/*from  w w w  .  j  a  v a2  s  . c  o  m*/
    objectMapper = new ObjectMapper();
    // see http://wiki.fasterxml.com/JacksonJAXBAnnotations
    AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
    AnnotationIntrospector secondary = new JaxbAnnotationIntrospector(TypeFactory.defaultInstance());
    AnnotationIntrospectorPair pair = new AnnotationIntrospectorPair(primary, secondary);
    objectMapper.setAnnotationIntrospector(pair);
}