[Xml-compile] XML document as an embedded CData section

Christopher Taranto christopher at tokpela.com
Thu Aug 30 19:18:22 GMT 2018


Hi Mark,



How do you post an XML document as an embedded CData section?



My test script is receiving a 500 server error because the XML that I am
sending is being escaped before it is being sent to the server.

The remote SOAP service reads the XML file on the fly when being posted and
cannot parse the request because the XML is escaped.



Here is what was explain generated from the WSDL (a very simple service):

#--------------------------------------------------------------

$parameters =

# Describing complex tns:post

#     {http://intake.vox.dds.net/}post

# xmlns:tns       http://intake.vox.dds.net/



# is a tns:post

{ # sequence of xml



  # is a xs:string

  # is optional

  xml => "example", };



Here is my XML::Compile code (relevant snippet):



my $transport = XML::Compile::Transport::SOAPHTTP->new(soap =>
$soap_version);

my $client_call = $xml_compile->compileClient($operation_name,


               user_agent
=> $ua,


port       => $service_port,


trans      => $transport);

my $xml_contents = read_file($input_filepath, { binmode => ':utf8' } );

my @request_params = (parameters => { xml => $xml_contents });

Here is a dump of the request from trace showing the XML file being escaped
- <xml>&lt;



'_request' => bless( {

'_protocol' => 'HTTP/1.1',

'_method' => 'POST',

'_content' => \'<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><tns:post
xmlns:tns="http://intake.vox.dds.net/"><xml>&lt;adsml-fi:AdsMLFinancials

(shortened)

;&lt;/adsml-fi:Invoice&gt;&lt;/adsml-fi:AdsMLFinancials&gt;&#13;



Per the documentation that I am working from:


The invoice document is an xml document embedded as a CData section.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:int="http://mediahub.domain.com/">

               <soapenv:Header/>

               <soapenv:Body>

                              <int:post>

                                             <xml>InvoiceDocument</xml>

                              </int:post>

               </soapenv:Body>

</soapenv:Envelope>


I have looked all over the documentation for many of the different modules
but I have not been able to find anything that has helped me.


Any direction would be greatly appreciated!


Thank you!


Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20180830/447de0d4/attachment.htm>


More information about the Xml-compile mailing list