开发者

Returning info from a Web Service

开发者 https://www.devze.com 2023-01-31 01:38 出处:网络
A support person from an organization indicated that their product wasn\'t able to consume my web service because it appeared I was returning ASCII encoded information, versus UTF-8 encoded informatio

A support person from an organization indicated that their product wasn't able to consume my web service because it appeared I was returning ASCII encoded information, versus UTF-8 encoded information.

[WebMethod]
public string ReturnAll(){
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.Load(@"some_dir\stockresults.xml");
    XmlNodeList nodeList = xmlDoc.SelectNodes(@"/entries/Entry/Company|/entries/Entry/Symbol");
开发者_JAVA百科    //public static string value;
    foreach (XmlNode org in nodeList)
    {
      value += org.OuterXml;
    }
    return value;
}

Any online references to what I'd need above to change it to the right encoding? Will I have to do something special in my method to re-encode the information before returning it?


Marco, UTF-8 is a default one.

Check this configuration option - http://msdn.microsoft.com/en-us/library/hy4kkhe0(v=VS.90).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消