12,166
社区成员




<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);
}
}