KB Article #178533
How to create attachment for outbound Web Services request?
Problem
How to create attachment for outbound Web Services request?
Resolution
In order to send a payload as an attachment you need to specialize web services in collaboration settings. Set the Payload location to "Attachment".
If you want to send payload as attachments to a single server, specialize collaboration settings at partner delivery level.
In case you are creating the SOAP header in the mapping and using ws.bodytype equal to SOAPHeaderAndBody you can use addAttachment DML function to add attachments. or example:-
addAttachment( "application/text",convertToV( "test" ), "base64", true )