Hello,

> I have the following problem:
> I have a service that does MTOM. In a Module on the client side, i need
> to do some xslt transformation on the soap structure. But when I do that
> (I use Saxon9 for xslt transformation) I need to convert that SOAP
> message to a string to apply that xslt transformer. When I rebuild the
> transformed soap envelope again with the StAXSOAPModelBuilder all MTOM
> information is somehow lost...
When you convert the whole SOAP message to a String using Axiom API's,
the MTOM attachments become text nodes having the attachment content
encoded in base64. But if you write the message object model using
MTOMWriter, then those text nodes will be written as attachments.. But
if you just took out the string, then there won't be any information
about MTOM..

Also on a side note use the MTOMStAXSOAPModelBuilder if you want to
build a MTOM message.. But it will not solve your issue..
>
> I already tried to get the MTOM attachments on the client side inside
> the module, but there the attachmentsmap conveyed in the message context
> is empty.
Did you try monitoring the actual wire level message & did you see the
attachment's in it..
One reason might be that the attachments are still not build due to
differed building of Axis2. Try calling
SOAPEnvelope.buildWithAttachments();

> My question now is: how can I preserve mtom information after in the
> client module when I need to transform the soap string?
Should be possible if you need only to transform the contents of the
root mime part, as you have mentioned below.
> On the server
> side I managed to do it by reading out the 0th attachments, which is the
> soap envelope and alter this one. Through that the attachments are not
> built into the soap envelope. But on the client module I do not seem to
> have access to the MTOM message... is it somehow possible to intercept
> the MTOM message on the client side?
Same as in the server...
> Btw: the module's handler on the client side is bount to the MessageOut
> phase.
hmm...too bad.. I was under the impression that you are talking about
receiving a message in the client side. In this case attachments are
not processed and they are not in the MAP.. AttachmentMAP is populated
only for incoming messages.

Only clear solution I can think of is to manually traverse the rebuilt
SOAPMessage and then to mark all the text nodes that contains binary
content as follows..

textNode.setBinary(true);
textNode.setOptimized(true);

thanks,
Thilina
>
> Thanks for your help and input,
> Best regards
> Simon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to