2

I am calling a web service using SOAP::Lite module as follows:

my $som = $soap->call('ns:xxx' =>
           (
            SOAP::Data->name('ns:data' =>
            \SOAP::Data->value(
               SOAP::Data->name('username')->type('')->value($username),
             )
          )
      )
  );

It did not work. So I called web service using SOAPUI tool to see xml structure.

Then I run my code at debug mode (use SOAP::Lite 'debug'), see created xml and compared with the xml of SOAPUI tool. The only difference is that SOAPUI xml contains CDATA tag as follow:

<![CDATA[
   xml
]]>

I searched and saw that CDATA is used to prevent error caused by special characters

How can I add this tag using Perl code?

clt60
  • 62,119
  • 17
  • 107
  • 194
kadir_beyazli
  • 197
  • 2
  • 12

1 Answers1

0

Use XML::Generator to encode the CDATA section. Then put it in the relevant soap structure.

rahed h
  • 41
  • 1