I tried that, like so (not actual code):

# $xml_content is <Attributes>…</Attributes><Content>…</Content>
my $xop = XML::Compile::XOP->new;
my $content = $xop->bytes( $xml_content, type => ‘text/xml’ );
# Call to submitLargeDocument has been compiled already
$wsdl->call( ‘submitLargeDocument’, parameters => { Document => $content } );

And when I look at the content just before it’s sent to the server, I don’t see 
that it’s being translated into MTOM. Instead I see:

<?xml version="1.0" encoding="UTF-8"?>
<soap11:Envelope xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/";>
    <wsa:ReplyTo xmlns:wsa="http://www.w3.org/2005/03/addressing";>
      <tns0:Document><!-- # Long base64 string redacted --> tns0:Document>

I expect this is happening because of the following element in the WSDL:

            <xsd:element name="submitLargeDocument">
                        <xsd:element maxOccurs="1" minOccurs="1" 
name="Document" nillable="true" type="nsm:StreamBody" 

Am I doing the XOP right, and if so, how do I put this into MTOM, rather than 
just base64 encoding the XML fragment? Do I need to fiddle the WSDL somehow?

Kit Peters
Doer of Things, ATS Integrations
D: +1 949 793 8208   M: +1 816 200 0279

On 10/17/16, 04:54, "Mark Overmeer" <m...@overmeer.net> wrote:

    * Kit Peters (kit.pet...@broadbean.com) [161014 15:33]:
    > How do I make an XOP request using XML::Compile::WSDL11? I’ve seen
    > the XOP unit test in XML::Compile::SOAP, but I’m not sure how to adapt
    > that to a compiled call with XML::Compile::WSDL11.
    Produce the XOP Include elements and put them in your data-tree on the
    usual spot for that data.  During the creation of the SOAP message,
    it will get attached and replaced by the attachement reference.
           Mark Overmeer MSc                                MARKOV Solutions
           m...@overmeer.net                          soluti...@overmeer.net
    http://Mark.Overmeer.net                   http://solutions.overmeer.net

Xml-compile mailing list

Reply via email to