Html encoding SOAP response

Discussion in 'ASP .Net' started by Casper Hornstrup, Dec 15, 2003.

  1. Is there anyway I can make my xml webservice not htmlencode the response
    from a call to an API?

    I have:
    public int PerformOperation(string operation, out string result)

    The content of result is html encoded, but since it contains valid xml,
    I should get away with not htmlencoding it, or not?

    <soap:Body>

    <PerformOperationResponse xmlns="http://tempuri.org/">

    <PerformOperationResult>

    0

    </PerformOperationResult>

    <result>

    &lt;RetrieveTreeResponse id=&quot;123&quot;&gt;

    &lt;Node id=&quot;1&quot;
    title=&quot;TopLevelNode1&quot;&gt;

    &lt;Node id=&quot;2&quot;
    title=&quot;2LevelNode1&quot; /&gt;

    &lt;Node id=&quot;3&quot;
    title=&quot;2LevelNode2&quot; /&gt;

    &lt;/Node&gt;

    &lt;Node id=&quot;4&quot;
    title=&quot;TopLevelNode2&quot; /&gt;

    &lt;/RetrieveTreeResponse&gt;

    </result>

    </PerformOperationResponse>

    </soap:Body>
    Casper Hornstrup, Dec 15, 2003
    #1
    1. Advertising

  2. Casper Hornstrup wrote:

    > Is there anyway I can make my xml webservice not htmlencode the response
    > from a call to an API?
    >
    > I have:
    > public int PerformOperation(string operation, out string result)
    >
    > The content of result is html encoded, but since it contains valid xml,
    > I should get away with not htmlencoding it, or not?


    Try to use a parameter of type XmlNode instead of a string.

    > <soap:Body>
    >
    > <PerformOperationResponse xmlns="http://tempuri.org/">
    >
    > <PerformOperationResult>
    >
    > 0
    >
    > </PerformOperationResult>
    >
    > <result>
    >
    > &lt;RetrieveTreeResponse id=&quot;123&quot;&gt;
    >
    > &lt;Node id=&quot;1&quot;
    > title=&quot;TopLevelNode1&quot;&gt;
    >
    > &lt;Node id=&quot;2&quot;
    > title=&quot;2LevelNode1&quot; /&gt;
    >
    > &lt;Node id=&quot;3&quot;
    > title=&quot;2LevelNode2&quot; /&gt;
    >
    > &lt;/Node&gt;
    >
    > &lt;Node id=&quot;4&quot;
    > title=&quot;TopLevelNode2&quot; /&gt;
    >
    > &lt;/RetrieveTreeResponse&gt;
    >
    > </result>
    >
    > </PerformOperationResponse>
    >
    > </soap:Body>
    >
    >
    >
    >


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Dec 15, 2003
    #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. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,832
    Jon Skeet [C# MVP]
    Jun 9, 2004
  2. Replies:
    1
    Views:
    23,344
    Real Gagnon
    Oct 8, 2004
  3. comp.text.xml
    Replies:
    0
    Views:
    508
    comp.text.xml
    Sep 20, 2006
  4. Ivan S
    Replies:
    0
    Views:
    531
    Ivan S
    Aug 13, 2008
  5. Casper Hornstrup

    Html encoding SOAP response

    Casper Hornstrup, Dec 15, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    122
Loading...

Share This Page