Again, I used the defaults. Just tried switching to Aegis and that did the trick :)
Thanks a lot for pointing me in the right direction. /Chr -----Original Message----- From: Benson Margulies [mailto:[email protected]] Sent: 24. januar 2010 14:03 To: [email protected] Subject: Re: XFire to CXF - wrapping arrays Did you configure CXF with Aegis or JAXB? this looks like you are getting the JAXB sort of array, or Aegis with the new 'flat' option turned on (which I thought was off by default). On Sun, Jan 24, 2010 at 7:58 AM, Christian Landbo Frederiksen <[email protected]> wrote: > XFire is setup using defaults, so I guess that would be Aegis yes. > > > -----Original Message----- > From: Benson Margulies [mailto:[email protected]] > Sent: 24. januar 2010 13:45 > To: [email protected] > Subject: Re: XFire to CXF - wrapping arrays > > Are you sure you were using JAXB and not Aegis with XFire? > > On Sun, Jan 24, 2010 at 4:07 AM, Christian Landbo Frederiksen > <[email protected]> wrote: >> I am upgrading an old XFire webservice to the latest edition of CXF. >> >> >> >> I am hoping I can do this with no changes to the web service interface >> (WSDL). >> >> >> >> I my XFire edition methods that return arrays resulted in a type e.g: >> ArrayOfErrorCode: >> >> >> >> <getErrorCodesResponse xmlns="http://namespace.dk"> >> >> <ErrorCodes> >> >> <ErrorCode>BAD_INPUT</ErrorCode> >> >> <ErrorCode>OTHER_ERROR</ErrorCode> >> >> ... >> >> >> >> In CXF I don't get that wrapping: >> >> >> >> <ns2:getErrorCodesResponse xmlns:ns2="http://namespace.dk/"> >> >> <ErrorCodes>BAD_INPUT</ErrorCodes> >> >> <ErrorCodes>OTHER_ERROR</ErrorCodes> >> >> .... >> >> >> >> >> >> I have tried wrapping the response in an ErrorCodes class that contains >> the array: >> >> >> >> public final class ErrorCodes { >> >> >> >> private ErrorCode[] ErrorCode; >> >> >> >> <ns2:getErrorCodesResponse xmlns:ns2="http://namespace.dk/"> >> >> <ErrorCodes> >> >> <errorCode>BAD_INPUT</errorCode> >> >> <errorCode>OTHER_ERROR</errorCode> >> >> .... >> >> >> >> Almost there but notice the 'e' is not an 'E'. >> >> >> >> So I added >> >> >> >> @XmlElement(namespace="", name="ErrorCode") >> >> private ErrorCode[] ErrorCode; >> >> >> >> But then I get two elements in the response: >> >> >> >> <ns2:getErrorCodesResponse >> xmlns:ns2="http://ws.brugerinformation.dk/"> >> >> <ErrorCodes> >> >> <ErrorCode>BAD_INPUT</ErrorCode> >> >> <ErrorCode> OTHER_ERROR </ErrorCode> >> >> <errorCode>BAD_INPUT</errorCode> >> >> <errorCode> OTHER_ERROR </errorCode> >> >> .... >> >> >> >> Which seems pretty odd to me. >> >> >> >> Does anybody have any idea how to solve this? Perhaps there is a JAXB >> annotation or a CXF configuration? >> >> >> >> /Christian >> >> >> >> >> >> >
