Hi guys,
I solved the problem already. I created a new POJO class (BinaryObject) with
XML annoations @see
http://cxf.apache.org/docs/mtom-attachments-with-jaxb.html. I modified the
ComplexObject adapter to extends XmlAdapter<BinaryObject, DicomObject>.
That's all!
Apache CXF is great, but the documentation should be updated :)
Thx a lot!
Greets,
xetrix
xetrix wrote:
>
> Hi,
>
> I have a service interface:
>
> @WebService
> Interface {
>
> @XmlJavaTypeAdapter(ComplexObjectAdapter.class)
> public ComplexObject getComplexObject();
> }
>
> ComplexObject is an interface of a library. So I cant use annotations in
> the implemenation class for JAXB binding. My solution right now is to use
> the ComplexObjectAdapter to convert the object to a string (read byte
> array stream and encode with base64). This is quite slow and it doesnt
> scale for bigger object sizes!
>
> I think there is a better solution to put that byte array stream as an
> attachment, but I dont know what is the best solution. I dont want to
> change the service interface and I have to use the ComplexObject
> interface.
>
> I tried to use the SwAOutInterceptor and the AttachmentOutInterceptor but
> it doesnt work. The data is included in the body part.
>
> This is my Client Interceptor Chain:
> receive [AttachmentInInterceptor]
> pre-stream [CertConstraintsInterceptor]
> post-stream [StaxInInterceptor]
> read [ReadHeadersInterceptor, SoapActionInInterceptor]
> pre-protocol [MustUnderstandInterceptor]
> post-protocol [CheckFaultInterceptor,
> JAXBAttachmentSchemaValidationHack]
> unmarshal [URIMappingInterceptor, DocLiteralInInterceptor,
> SoapHeaderInterceptor]
> pre-logical [OneWayProcessorInterceptor]
> post-logical [WrapperClassInInterceptor]
> pre-invoke [SwAInInterceptor, HolderInInterceptor]
> invoke [ServiceInvokerInterceptor]
> post-invoke [OutgoingChainInterceptor]
>
> This is my Server Interceptor Chain:
> pre-logical [HolderOutInterceptor, SwAOutInterceptor,
> WrapperClassOutInterceptor, SoapHeaderOutFilterInterceptor]
> post-logical [SoapPreProtocolOutInterceptor]
> prepare-send [MessageSenderInterceptor]
> pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
> pre-protocol [SAAJOutInterceptor]
> write [SoapOutInterceptor]
> marshal [WrappedOutInterceptor, BareOutInterceptor]
> prepare-send-ending [MessageSenderEndingInterceptor]
>
>
> I guess I cant use the MTOM transfer mode, right? I dont want to change my
> interfaces to use the data handler.
>
> Thanks a lot for your help!
>
--
View this message in context:
http://old.nabble.com/Byte-Array-To-Attachments%3A-Attachment-and-SwA-In---Out-Interceptor--tp28398159p28410769.html
Sent from the cxf-user mailing list archive at Nabble.com.