使用SOAP调用调用WCF
问题描述:
我想使用SOAP调用WCF服务?使用SOAP调用调用WCF
这是我的合同:
[ServiceContract(Namespace = "http://www.MySite.com/Services/TransferFile")]
public interface ITransferFile : ICloseableAndAbortable
{
/// <summary>
/// This will send the file which is associated with this rule to all the subscribers.
/// </summary>
/// <param name="ruleId"></param>
[OperationContract]
void ByRuleId(int ruleId);
}
当前设置为这种结合,将我需要改变呢?
<endpoint address="" binding="wsHttpBinding" contract="FileTransfer.Wcf.ITransferFile">
那么我怎么称呼它通过肥皂?例如使用(HttpWebRequest的)的WebRequest
很多感谢
答
- 更改绑定到basicHttpBinding的
2消息
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ByRuleId xmlns="http://www.MySite.com/Services/TransferFile">
<ruleId>3</ruleId>
</ByRuleId>
</soap:Body>
</soap:Envelope>
3肥皂动作
POST /FileTransferService/TransferFile.svc HTTP/1.1
SOAPAction: "http://www.MySite.com/Services/TransferFile/ITransferFile/ByRuleId"
FYI我要求(HttpWebRequest的)的WebRequest,仅作为一个可行的方式,我结束了使用Web引用和提琴手
我有一个正在使用Sharepoint设计器的同事,创建一个将调用Web服务的工作流,snag是他正在使用的第三方工具无法做到的WCF,它只能理解SOAP Action和body ..因此我正在寻找一个简单的例子我可以在.net(WebRequest)中测试,然后通过他所需的字符串 – dbones 2009-09-25 14:22:40