关于 WSE3 中断言策略的好资源

发布于 2024-07-15 03:14:53 字数 33 浏览 6 评论 0原文

我在哪里可以找到有关 WSE3 中断言策略的好资源?

where can i find a good resource about assert policies in WSE3 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

审判长 2024-07-22 03:14:53

你指的是 WSE 还是 WCF? 我注意到您标记了问题“.net3.5”,这表明 wcf。

WSE3(OTOH)是一个基于 .NET 2.0 ASMX 技术的过时框架,该技术本身也几近过时。

这并不反映你的问题:如果你别无选择,只能使用 WSE,那么你别无选择。 只是想澄清您所问的问题(并确保您知道 WSE 已过时;并非每个使用它的人都知道这一点)。

Did you mean WSE or WCF? I noticed you tagged the question ".net3.5", which suggests wcf.

WSE3, OTOH, is an obsolete framework based on .NET 2.0 ASMX technology, which is nearly obsolete itself.

This does not reflect on your question: if you have no choice but to use WSE, then you have no choice. Just want to clarify which you're asking about (and make sure you know WSE is obsolete; not everyone using it knows that).

看春风乍起 2024-07-22 03:14:53

我在这个领域是个初学者。 我正在尝试将这段代码作为练习来实现。
我想创建一个肥皂过滤器,它将在肥皂消息到达时运行。
我在使用政策 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");
    }

}

}

I'm quite a beginner in this feild. i'm trying to implement this code as an exersice.
i want to create a soapfilter that will run as a soap message arrives.
I'm having trouble with the policy 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");
    }

}

}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文