Loading ...
Sorry, an error occurred while loading the content.
 

RE: [soaplite] CDATA & SOAP::Lite

Expand Messages
  • gary_grubb@agilent.com
    Thanks, I realized after the post that it just did it without any modifiactions. Thanks, Gary ... From: Duncan Cameron [mailto:duncan_cameron2002@yahoo.co.uk]
    Message 1 of 4 , Oct 22 10:08 AM
      Thanks, I realized after the post that it just did it without any modifiactions. Thanks, Gary
      -----Original Message-----
      From: Duncan Cameron [mailto:duncan_cameron2002@...]
      Sent: Friday, October 22, 2004 4:03 AM
      Cc: soaplite@yahoogroups.com
      Subject: Re: [soaplite] CDATA & SOAP::Lite

      At 2004-10-22, 06:40:43 Byrne Reese <byrne@...> wrote:
      >garygrub wrote:
      >
      >> Does SOAP::LIte support XML CDATA? If, so is there anything special
      >> that I have to do?
      >>
      >> Gary Grubb
      >> 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
      serialised as

      <foo xsi:type="xsd:string">
      &lt;![CDATA[ ---my data goes here --- ]]&gt;</foo>
      </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
      XML too)

      SOAP::Data->type('xml', '<![CDATA[ ---my data goes here --- ]]>');

      This will be serialised as

      <![CDATA[ ---my data goes here --- ]]>

      Regards
      Duncan



    Your message has been successfully submitted and would be delivered to recipients shortly.