为什么WCF respone包含在< string xmlns =" http://schemas.microsoft.com/2003/10/Serialization/">之间。 < /串GT; [英] Why WCF respone is wrapped between <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> </string>

查看:83
本文介绍了为什么WCF respone包含在< string xmlns =" http://schemas.microsoft.com/2003/10/Serialization/">之间。 < /串GT;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调用API时,我收到如下响应



While calling the API I am getting the response as below

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">ABC</string>





如何在创建WCF服务时删除它? ?



How Can It Be removed while creating WCF service???

推荐答案

您可以尝试将BodyStyle设置为裸:

You can try setting BodyStyle to bare:
[OperationContract]
[WebGet(BodyStyle = WebMessageBodyStyle.Bare)]
public string GetString()
{
    return "ABC";
}


public String cleanOUTPUT(String OUTPUT){

OUTPUT = OUTPUT.replaceAll(, );

OUTPUT = OUTPUT.replaceAll(,);

返回OUTPUT;

}
public String cleanOUTPUT(String OUTPUT) {
OUTPUT = OUTPUT.replaceAll("","");
OUTPUT = OUTPUT.replaceAll("", "");
return OUTPUT;
}


这篇关于为什么WCF respone包含在&lt; string xmlns =&quot; http://schemas.microsoft.com/2003/10/Serialization/&quot;&gt;之间。 &LT; /串GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆