请教一个WCF返回格式的问题
目前返回的格式是
而目标想得到的目标值是
请问下这个前缀如何设置?
主要疑问点就是如何在节前前面加上那个点缀?
以下附带了目前使用代码:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<InvokeResponse xmlns="http://localhost/BOI/">
<InvokeResult>
<InvokeResult>true</InvokeResult>
<result>OK</result>
</InvokeResult>
</InvokeResponse>
</s:Body>
</s:Envelope>而目标想得到的目标值是
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<boi:InvokeResponse xmlns:boi="http://localhost/BOI/">
<boi:InvokeResult>
<boi:InvokeResult>true</boi:InvokeResult>
<boi:result>OK</boi:result>
</boi:InvokeResult>
</InvokeResponse>
</s:Body>
</s:Envelope>请问下这个前缀如何设置?
主要疑问点就是如何在节前前面加上那个点缀?
以下附带了目前使用代码:
namespace WcfServiceLibrary
{
public delegate string DisplayContent(string content);
// 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的类名“Service1”。
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, Namespace = "http://localhost/BOI/")]
[XmlSerializerFormat]
public class WServiceInstance : IService_Contract
{
public DisplayContent AddContent;
public BoiResult Invoke(string form, string token, string funcName, string parameters)
{
var jsonres = AddContent(form + ";" + token + ";" + funcName + ";" + parameters);
var data = new BoiResult();
data.InvokeResult = true;
data.result = jsonres;
return data;
}
}
[DataContract(Namespace = "")]
[XmlSerializerFormat]
public class BoiResult
{
[DataMember]
public bool InvokeResult;
[DataMember]
public string result;
}
}namespace WcfServiceLibrary
{
// 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的接口名“IService_Contract”。
[ServiceContract(Namespace = "http://localhost/BOI/")]
[XmlSerializerFormat]
public interface IService_Contract
{
[OperationContract(Action = "", Name = "Invoke")]
BoiResult Invoke(string form, string token, string funcName, string parameters);
}
}
...全文
相关推荐
WCF客户端测试工具,亲测可用
WCF客户端测试工具,亲测可用,测试WCF链接是否可用,测试WCF里面的方法,查看返回的值,亲测可用,只有我这个能用,其他的版本都是不完全版本,就算没有安装VS也可以使用的.认准我的标题
ajax调用WCF服务
本代码演示了使用JQUERY的AJAX方法调用WCF服务的例子,各种方法都做了演示。
php调用WCF服务
php调用WCF,返回list〈T〉的结果,传入参数,传入带List<T>的参数
使用js+ajax调用WCF服务
使用js+ajax调用WCF服务,博客地址:http://blog.csdn.net/zaijianluoye110/article/details/25364945
jquery 调用WCF :多参数
jquery 调用WCF :多参数 WCF服务接口,创建服务,jquery 通过post方式取得数据


Web Services
