springsoapbinaryattachmentmtom

Spring SOAP Mtom attachment's identifier encoding problem


I created a SOAP client in my Spring Boot (2.5.5) server. The envelope is marshalled, the communication works, but I have got an error which said I not attached the binary (file) data.

In my log file the soap message has it and there is a binary attachment.

The only strange thing is, in the Include tags href attibute has a %40 character instead of @ character like this:

...
<ns2:DocuData xmlns:ns2="namespace 1">
   <ns2:fileContent>
    <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" 
                 href="cid:946ff3f8-e725-4cca-8108-676403be336f%40domain.hu"/>
   </ns2:fileContent>
</ns2:DocuData>
...

In the multipart data section the Content-ID is:

...
------=_Part_1_22457057.1633284795352
Content-Type: application/octet-stream
Content-ID: <946ff3f8-e725-4cca-8108-676403be336f@domain.hu>
Content-Transfer-Encoding: binary

...
content
...
------=_Part_1_22457057.1633284795352--

Is it the cause of the problem? How can I solve it?

Thanks for any help!


Solution

  • It was my fault! I read out the data from the stream when I logged the request in the interceptor. I turned off the logging and the message sent successfully.