Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在WCF服务中解码HTML_Wcf_C# 4.0 - Fatal编程技术网

无法在WCF服务中解码HTML

无法在WCF服务中解码HTML,wcf,c#-4.0,Wcf,C# 4.0,某些有效的= 但是我得到了字符串s的值,比如<Dependent><DependentId> 注意:我没有申请在<之后,将其转换为参见问题 您正在寻找的数据类型是XElement或XmlElement作为返回类型 使用字符串作为返回类型的另一种简单方法是在服务中返回之前使用htmlencode,在客户端中使用htmldecode public string ReturnString() { string s = ""; s = HttpUtility.SomeValiable

某些有效的=

但是我得到了字符串s的值,比如<Dependent><DependentId>

注意:我没有申请<之后,将其转换为参见问题

您正在寻找的数据类型是XElement或XmlElement作为返回类型

使用字符串作为返回类型的另一种简单方法是在服务中返回之前使用htmlencode,在客户端中使用htmldecode

public string ReturnString()
{
string s = "";
s = HttpUtility.SomeValiable;
return s;
}