我通过WCF连接到第三方端点,我有一个问题.WCF生成的SOAP信封的模式与端点不兼容.
目前WCF正在生成:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
Run Code Online (Sandbox Code Playgroud)
但它必须是这样的:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing">
Run Code Online (Sandbox Code Playgroud)
我在soapUI中对此进行了测试以确认这是问题,但我如何在WCF中控制它?我使用Visual Studio中的"添加服务引用"选项来生成服务.
有任何想法吗?
提前致谢.
安迪
考虑以下因素QueryOver(季度和中心是传入的变量):
QueryOver.Of<Activity>()
.Where(Restrictions.On<Activity>(a => a.StartDate).IsBetween(quarter.StartDate).And(quarter.EndDate) ||
Restrictions.On<Activity>(a => a.EndDate).IsBetween(quarter.StartDate).And(quarter.EndDate) ||
Restrictions.And(Restrictions.Lt("StartDate", quarter.StartDate), Restrictions.Gt("EndDate", quarter.EndDate))) //TODO: Refactor this to remove magic strings
.And(a => a.Centre == centre)
.OrderBy(a => a.Title).Asc;
Run Code Online (Sandbox Code Playgroud)
此查询工作正常,但我想更改以下限制以删除魔术字符串:
Restrictions.And(Restrictions.Lt("StartDate", quarter.StartDate), Restrictions.Gt("EndDate", quarter.EndDate))
Run Code Online (Sandbox Code Playgroud)
以下是实体(为简洁而剪裁):
public class Quarter
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
public class Activity
{
public string Title { get; set; }
public Centre Centre { get; set; }
public DateTime StartDate { get; set; …Run Code Online (Sandbox Code Playgroud)