Html encoding SOAP response

Discussion in 'ASP .Net Web Services' 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

    JD Guest

    Change your out param to either an XmlNode or XmlDocument object instead of
    string and it will not be encoded. To the best of my knowledge the
    framework encodes all string return values.

    "Casper Hornstrup" <> wrote in message
    news:...
    > 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>
    >
    >
    >
     
    JD, 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. Casper Hornstrup

    Html encoding SOAP response

    Casper Hornstrup, Dec 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,716
    Martin Honnen
    Dec 15, 2003
  2. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    19,062
    Jon Skeet [C# MVP]
    Jun 9, 2004
  3. Replies:
    1
    Views:
    23,578
    Real Gagnon
    Oct 8, 2004
  4. comp.text.xml
    Replies:
    0
    Views:
    544
    comp.text.xml
    Sep 20, 2006
  5. Ivan S
    Replies:
    0
    Views:
    559
    Ivan S
    Aug 13, 2008
Loading...

Share This Page