题
我在哪里可以找到有关WSE3断言政策一个很好的资源?
解决方案 2
我在这个费尔德相当初学者。我想要实现这个代码作为exersice。 我想创建一个SOAP消息到达,将运行一个soapfilter。 我在与策略XML麻烦
using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Design;
namespace WebService1
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld(string s)
{
return "Hello World" +s ;
}
}
public class ValidationFilter : SoapFilter
{
string authCode;
public ValidationFilter(string authCode)
{
this.authCode = authCode;
}
public override SoapFilterResult ProcessMessage(
SoapEnvelope envelope)
{
XmlReaderSettings settings = new XmlReaderSettings();
XmlElement elmRoot = envelope.DocumentElement;
XmlElement elmNew = envelope.CreateElement("title1234");
elmNew.InnerXml = "blablabla";
elmRoot.AppendChild(elmNew);
return SoapFilterResult.Continue;
}
}
public class traceAssertion : PolicyAssertion
{
public static readonly XmlQualifiedName BeNiceQName = new
XmlQualifiedName("traceAssertion", "http://schemas.cohowinery.com/wsbn");
public override SoapFilter CreateClientInputFilter(FilterCreationContext context)
{
return new ValidationFilter("FFFF");
}
public override SoapFilter CreateClientOutputFilter(FilterCreationContext context)
{
return new ValidationFilter("FFFF");
}
public override SoapFilter CreateServiceInputFilter(FilterCreationContext context)
{
return new ValidationFilter("FFFF");
}
public override SoapFilter CreateServiceOutputFilter(FilterCreationContext context)
{
return new ValidationFilter("FFFF");
}
}
}
其他提示
你的意思是WSE或WCF?我注意到您所标记的问题” .NET3.5" ,这表明WCF。
WSE3,OTOH,是基于.NET 2.0 ASMX技术,这是近过时本身。一个过时的框架
这并不能反映你的问题:如果你没有选择,只能使用WSE,那么你别无选择。只是想澄清你问(并确保你知道WSE是过时的;使用不是每个人都它知道)
。不隶属于 StackOverflow