Re: Returning XML from a SOAP call

Discussion in 'XML' started by Joe Fawcett, Jan 9, 2009.

  1. Joe Fawcett

    Joe Fawcett Guest

    "Peter Olcott" <> wrote in message
    news:...
    > Is there any way to return XML from a SOAP call without the special
    > characters such as "<" being encoded as &lt; ???
    >

    To be valid XML they have to encoded or within a CDATA section, but that
    only applies to text within elements. So if you were crafting your own
    service you could force a CDATA section for the elements in question but
    attribute values would still have to be encoded. I don't know of any of the
    popular SOAP frameworks that allow you to specify CDAT sections in their
    configuration.

    --

    Joe Fawcett
    http://joe.fawcett.name
    Joe Fawcett, Jan 9, 2009
    #1
    1. Advertising

  2. Joe Fawcett

    Joe Fawcett Guest

    "Peter Olcott" <> wrote in message
    news:...
    >
    > "Joe Fawcett" <> wrote in message
    > news:gk72bp$en5$...
    >>
    >>
    >> "Peter Olcott" <> wrote in message
    >> news:...
    >>> Is there any way to return XML from a SOAP call without the special
    >>> characters such as "<" being encoded as &lt; ???
    >>>

    >> To be valid XML they have to encoded or within a CDATA section, but that
    >> only applies to text within elements. So if you were crafting your own
    >> service you could force a CDATA section for the elements in question but
    >> attribute values would still have to be encoded. I don't know of any of
    >> the popular SOAP frameworks that allow you to specify CDAT sections in
    >> their configuration.

    >
    > The system that we are using is gsoap.
    >

    Not one I've come across. But the fact is that either you need non
    well-formed 'XML', in which case no self-respecting system will do that, or
    you can use CDATA, which is only a convenience anyway. No XML parser will
    care whether you have: <data> 1 & l t ; 2</data> (spaces for readability) or
    <data><![CDATA[ 1 < 2 ]]></data>
    Strive to fix whatever system needs non well-formed XML to operate or we'll
    end up with the same problems that beset us with browsers that repair bad
    HTML.

    --

    Joe Fawcett (MVP - XML)
    http://joe.fawcett.name
    Joe Fawcett, Jan 10, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    11
    Views:
    661
    Christos Georgiou
    May 2, 2006
  2. jaja
    Replies:
    0
    Views:
    687
  3. Steve Kuhn
    Replies:
    2
    Views:
    351
    majiofpersia
    Jul 29, 2003
  4. Dan Fitzpatrick
    Replies:
    1
    Views:
    343
    NAKAMURA, Hiroshi
    Jul 16, 2005
  5. Patrick Put
    Replies:
    0
    Views:
    102
    Patrick Put
    Aug 25, 2008
Loading...

Share This Page