Hello,
im using org.springframework.oxm.jaxb.Jaxb2Marshaller in endpoints and clients. I have problem unmarhsalling simple JAXBElements which are not mapped in marshaller/umharshaller. My endpoint method looks like this:
where of is my generated ObjectFactory.Code:@PayloadRoot(localPart = "GetXRequest", namespace = "http://namespace") public JAXBElement<String> getX(GetXRequest request) { return of.createGetXResponse("test"); }
createGetXResponse looks like this:
My client is trying to use web service's endpoint method:Code:private final static QName _GetXResponse_QNAME = new QName("http://namespace", "GetXResponse"); @XmlElementDecl(namespace = "http://namespace", name = "GetXResponse") public JAXBElement<String> createGetXResponse(String value) { return new JAXBElement<String>(_GetXResponse_QNAME, String.class, null, value); }
and i get following exception:Code:ObjectFactory of = new ObjectFactory(); GetXRequest request = of.createGetXRequest(); Object result = getWebServiceTemplate().marshalSendAndReceive(request);
So, how should i unmarshall simple JAXBElements which are not maped in marshaller? Or should i somehow map them? How?Code:org.springframework.oxm.jaxb.JaxbUnmarshallingFailureException: JAXB unmarshalling exception: unexpected element (uri:"http://namespace", local:"GetXResponse"). Expected elements are ...
Thanks
Gravy


Reply With Quote