0

I am attempting to send a SOAP message with PowerShell that uses MTOM to attach an XML file. MTOM is the method specified by the web service so I don't have the option to include the XML file inline.

I'm getting confused when it comes to actually attaching the file to the SOAP message. I understand that the file is attached using the <xop:Include> element in the SOAP message. But how do I specify the value that should be included for the href attribute (i.e. how do I determine the string that should replace xxxxxxxxx?

In all the examples that I've seen up to now the value for href is always specified as something like 0ccceb3ce8deda6a3a666b587962a26a7524fe64d35d73ea@apache.org but I don't understand how this is generated.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header></soapenv:Header>
    <soapenv:Body>
        <ns1:RequestAttInfo xmlns:ns1="urn:abb.com:project/isem/types">
            <requestType xmlns="">mp.report</requestType>
            <adminRole xmlns="">false</adminRole>
            <requestDataCompressed xmlns="">false</requestDataCompressed>
            <requestDataType xmlns="">XML</requestDataType>
            <sendRequestDataOnSuccess xmlns="">true</sendRequestDataOnSuccess>
            <sendResponseDataCompressed xmlns="">false</sendResponseDataCompressed>
            <requestSignature xmlns="">yyyyyyyyy</requestSignature>
            <requestData xmlns="">
                <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:xxxxxxxxx"></xop:Include>
            </requestData>
        </ns1:RequestAttInfo>
    </soapenv:Body>
</soapenv:Envelope>
gerard
  • 835
  • 11
  • 27
  • I'm not 100% sure but is that not just a mime attachment? – Owain Esau Nov 21 '17 at 06:52
  • @owainesau It is included as a MIME attachment. My understanding is that the `` element is used to specify the MIME attachment. But I don't understand how the href value is generated. – gerard Nov 21 '17 at 08:42
  • this may help: https://erlerobotics.gitbooks.io/erle-robotics-python-gitbook-free/e-mail_composition_and_decoding/composing_mime_attachments.html – Owain Esau Nov 21 '17 at 22:52
  • @OwainEsau Thanks for that but unfortunately it's not what I'm looking for. This is a MIME attachment for an email. Although the MIME part is the same I'm specifically interested in MIME attachments in SOAP messages – gerard Nov 22 '17 at 12:39

0 Answers0