RE: [soaplite] CDATA & SOAP::Lite
- Thanks, I realized after the post that it just did it without any modifiactions. Thanks, Gary-----Original Message-----At 2004-10-22, 06:40:43 Byrne Reese <byrne@...> wrote:
From: Duncan Cameron [mailto:duncan_cameron2002@...]
Sent: Friday, October 22, 2004 4:03 AM
Subject: Re: [soaplite] CDATA & SOAP::Lite
>> Does SOAP::LIte support XML CDATA? If, so is there anything special
>> that I have to do?
>> Gary Grubb
>There is nothing "special" you have to do. You do have to encapsulate
>CDATA blocks yourself though. For example:
>$soap->myMethod(SOAP::Data->name("foo" => "<![CDATA[ ---my data goes
>here --- ]]>");
>That should do it.
As this data does not have a type() it will be treated as a string and
any XML special characters will be escaped, so the example will be
<![CDATA[ ---my data goes here --- ]]></foo>
At the server it will be deserialised into the original string
including the CDATA tag, which may not be what is wanted.
If you want to pass XML literally (including CDATA sections) as a
parameter then you need to type it as xml (and it has to be well-formed
SOAP::Data->type('xml', '<![CDATA[ ---my data goes here --- ]]>');
This will be serialised as
<![CDATA[ ---my data goes here --- ]]>