<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:Times;
        panose-1:2 0 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Calibri Light";
        panose-1:2 15 3 2 2 2 4 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Courier;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">What do your @request_params look like there? Because I’m not seeing anywhere that your request is being formatted as XOP/MTOM.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">KP<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Calibri;color:black">--<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.5pt;font-family:"Calibri Light";color:#919195">Kit Peters</span><span style="font-size:13.5pt;font-family:Times;color:black"><br>
</span><span style="font-size:9.5pt;font-family:"Calibri Light";color:#566B10">Doer of Things, ATS Integrations<br>
</span><span style="font-size:9.5pt;font-family:"Calibri Light";color:#919195">D: +1 949 793 8208 M: +1 816 200 0279</span><span style="font-size:11.0pt;font-family:Calibri"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">Christopher Taranto <christopher@tokpela.com><br>
<b>Date: </b>Monday, October 17, 2016 at 18:55<br>
<b>To: </b>Kit Peters <Kit.Peters@broadbean.com><br>
<b>Cc: </b>Mark Overmeer <mark@overmeer.net>, "xml-compile@lists.scsys.co.uk" <xml-compile@lists.scsys.co.uk><br>
<b>Subject: </b>Re: [Xml-compile] XOP with XML::Compile::WSDL11<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hi Kip, <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">@Hi Mark!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I've been using XOP for a few years in Production with XML::Compile in two different scripts. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">It's been a while since I had to put this together so I don't remember the particulars. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The below code is not the working code - as it is separated behind objects etc - but I think I have patched together the general theme:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I hope this helps!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Chris<o:p></o:p></p>
</div>
<div>
<pre style="white-space:pre-wrap"><span style="color:black">use XML::Compile::WSDL11; # use WSDL version 1.1<o:p></o:p></span></pre>
<pre><span style="color:black">use XML::Compile::SOAP11; # use SOAP version 1.1<o:p></o:p></span></pre>
<pre><span style="color:black">use XML::Compile::Transport::SOAPHTTP;<o:p></o:p></span></pre>
<pre><span style="color:black">use XML::Compile::XOP;<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">my $xml_compile = XML::Compile::WSDL11->new($primary_wsdl,<o:p></o:p></span></pre>
<pre><span style="color:black"> schema_dirs => \@schema_dirs) <o:p></o:p></span></pre>
<pre><span style="color:black"> || die "[Error] UNABLE TO CREATE XML::Compile::WSDL11 OBJECT";<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">foreach (@wsdls) {<o:p></o:p></span></pre>
<pre><span style="color:black"> $xml_compile->addWSDL($_);<o:p></o:p></span></pre>
<pre><span style="color:black">}<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">foreach (@schemas) {<o:p></o:p></span></pre>
<pre><span style="color:black"> $xml_compile->importDefinitions($_);<o:p></o:p></span></pre>
<pre><span style="color:black">}<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"># setup the XML::Compile transport for HTTP with the LWP user_agent<o:p></o:p></span></pre>
<pre><span style="color:black">my $ua = LWP::UserAgent->new(keep_alive => 1);<o:p></o:p></span></pre>
<pre><span style="color:black"> <o:p></o:p></span></pre>
<pre><span style="color:black">if ($jar_file) {<o:p></o:p></span></pre>
<pre><span style="color:black"> <o:p></o:p></span></pre>
<pre><span style="color:black"> $ua->cookie_jar( {file => $jar_file, <o:p></o:p></span></pre>
<pre><span style="color:black"> autosave => 1, <o:p></o:p></span></pre>
<pre><span style="color:black"> ignore_discard => 1 });<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">}<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">my $transport = XML::Compile::Transport::SOAPHTTP->new(user_agent => $ua, <o:p></o:p></span></pre>
<pre><span style="color:black"> soap => $self->soap_version);<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"># compile the client call <o:p></o:p></span></pre>
<pre><span style="color:black">my $client_call = $xml_compile->compileClient($operation_name, <o:p></o:p></span></pre>
<pre><span style="color:black"> port => $service_port, <o:p></o:p></span></pre>
<pre><span style="color:black"> trans => $transport);<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">my ($answer, $trace, $xops);<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">eval {<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"> ($answer, $trace, $xops) = $client_call->(@request_params);<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">};<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">if ($@) {<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"> die "[Error] UNABLE TO COMPLETE REQUEST: [$@] - ANSWER[$answer] - TRACE[$trace] - XOPS[$xops]";<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">}<o:p></o:p></span></pre>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Oct 17, 2016 at 4:27 PM, Kit Peters <<a href="mailto:Kit.Peters@broadbean.com" target="_blank">Kit.Peters@broadbean.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">I tried that, like so (not actual code):<br>
<br>
# $xml_content is <Attributes>…</Attributes><Content>…</Content><span style="font-family:PMingLiU"><br>
</span>my $xop = XML::Compile::XOP->new;<span style="font-family:PMingLiU"><br>
</span>my $content = $xop->bytes( $xml_content, type => ‘text/xml’ );<span style="font-family:PMingLiU"><br>
</span># Call to submitLargeDocument has been compiled already<span style="font-family:PMingLiU"><br>
</span>$wsdl->call( ‘submitLargeDocument’, parameters => { Document => $content } );<span style="font-family:PMingLiU"><br>
<br>
</span>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:<span style="font-family:PMingLiU"><br>
<br>
</span><?xml version="1.0" encoding="UTF-8"?><span style="font-family:PMingLiU"><br>
</span><soap11:Envelope xmlns:soap11="<a href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a>"><br>
<soap11:Header><br>
<wsa:MessageID xmlns:wsa="<a href="http://www.w3.org/2005/03/addressing" target="_blank">http://www.w3.org/2005/03/addressing</a>">Query-Export-5490E6F8-94BE-11E6-9A62-DBB52521867A</wsa:MessageID><br>
<wsa:ReplyTo xmlns:wsa="<a href="http://www.w3.org/2005/03/addressing" target="_blank">http://www.w3.org/2005/03/addressing</a>"><br>
<wsa:Address><a href="http://www.taleo.com/ws/integration/toolkit/2005/07/addressing/queue" target="_blank">http://www.taleo.com/ws/integration/toolkit/2005/07/addressing/queue</a></wsa:Address><br>
</wsa:ReplyTo><br>
<wsa:Action xmlns:wsa="<a href="http://www.w3.org/2005/03/addressing" target="_blank">http://www.w3.org/2005/03/addressing</a>"><a href="http://www.taleo.com/ws/integration/toolkit/2005/07/action/export" target="_blank">http://www.taleo.com/ws/integration/toolkit/2005/07/action/export</a></wsa:Action><br>
</soap11:Header><br>
<soap11:Body><br>
<tns0:submitLargeDocument xmlns:tns0="<a href="http://www.taleo.com/ws/integration/toolkit/2011/05/management" target="_blank">http://www.taleo.com/ws/integration/toolkit/2011/05/management</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><br>
<tns0:Document><!-- # Long base64 string redacted --> tns0:Document><br>
</tns0:submitLargeDocument><br>
</soap11:Body><br>
</soap11:Envelope><br>
<br>
I expect this is happening because of the following element in the WSDL:<br>
<br>
<xsd:element name="submitLargeDocument"><br>
<xsd:complexType><br>
<xsd:sequence><br>
<xsd:element maxOccurs="1" minOccurs="1" name="Document" nillable="true" type="nsm:StreamBody" nsxmlmime:expectedContentTypes="application/octet-stream"/><br>
</xsd:sequence><br>
</xsd:complexType><br>
</xsd:element><br>
<br>
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?<br>
<br>
KP<br>
--<br>
Kit Peters<br>
Doer of Things, ATS Integrations<br>
D: <a href="tel:%2B1%20949%20793%208208">+1 949 793 8208</a> M: <a href="tel:%2B1%20816%20200%200279">
+1 816 200 0279</a><br>
<br>
On 10/17/16, 04:54, "Mark Overmeer" <<a href="mailto:mark@overmeer.net">mark@overmeer.net</a>> wrote:<br>
<br>
* Kit Peters (<a href="mailto:Kit.Peters@broadbean.com">Kit.Peters@broadbean.com</a>) [161014 15:33]:<br>
> How do I make an XOP request using XML::Compile::WSDL11? I’ve seen<span style="font-family:PMingLiU"><br>
</span> > the XOP unit test in XML::Compile::SOAP, but I’m not sure how to adapt<span style="font-family:PMingLiU"><br>
</span> > that to a compiled call with XML::Compile::WSDL11.<span style="font-family:PMingLiU"><br>
<br>
</span> Produce the XOP Include elements and put them in your data-tree on the<span style="font-family:PMingLiU"><br>
</span> usual spot for that data. During the creation of the SOAP message,<br>
it will get attached and replaced by the attachement reference.<br>
--<br>
greetz,<br>
MarkOv<br>
<br>
------------------------------------------------------------------------<br>
Mark Overmeer MSc MARKOV Solutions<br>
Mark@Overmeer.net <a href="mailto:solutions@overmeer.net">
solutions@overmeer.net</a><br>
<a href="http://Mark.Overmeer.net" target="_blank">http://Mark.Overmeer.net</a> <a href="http://solutions.overmeer.net" target="_blank">http://solutions.overmeer.net</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Xml-compile mailing list<br>
<a href="mailto:Xml-compile@lists.scsys.co.uk">Xml-compile@lists.scsys.co.uk</a><br>
<a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>