English 中文(简体)
• 如何在http://www.un.org上添加习惯的肥皂头或用户名称?
原标题:How to add custom soap headers or use username auth under http?

我正试图修改和增加海关头盔,使之达到<代码>的飞跃信息。 更正前 类似方法:

    public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, IClientChannel channel)
    {
        MessageHeader header = MessageHeader.CreateHeader("name", "http://myname", "Oscar");
        request.Headers.Add(header);

        return null;
    }

此时此刻,歌手在像头一样的跳板上添加:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<ActivityId CorrelationId="51efbfdb-2187-45b9-81fc-6a38815d5bed" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d1351a78-a53a-4d32-ad35-fca6d4262adf</ActivityId>
<name xmlns="http://myname">Oscar</name>
</s:Header>

问题在于,我想在头脑中增加一些大事,最后结果必须如此:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<ActivityId CorrelationId="51efbfdb-2187-45b9-81fc-6a38815d5bed" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d1351a78-a53a-4d32-ad35-fca6d4262adf</ActivityId>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:Username xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">username</wsse:Username>
      <wsse:Password xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">password</wsse:Password>
    </wsse:UsernameToken>
</wsse:Security>
</s:Header>

是否有办法实现这一目标?

PS。 请辩:-)不要批评我,我的情况如下:

在增加这一用户名和密码时,你需要超过<条码><>>>><>/代码>,问题是,我试图通信的基于 Java的网络服务列在<条码>之下。 我认为,由于第3条链接<>,这一服务不符合规定。 在无担保关系上通过全权证书被认为是不好的做法。”

我也阅读了这些联系,并尝试了这些联系。 另外,在从第1和第2号链接中做事时,我在视频演播室中还有一个例外,如,预计可上网查阅“”。 因此,我正在尝试使用<条码>。

  1. Configure WCF for WS-security withusername over https

  2. http://www.sey-wind.com/weblog/posts/2007/Dec/09/Tracing-WCF-Messages

  3. http://www.fransson.net/blog/credentials-over-plain-http-with-wcf/

最佳回答

第3参数是制造头盔。 缺席时,该物体采用数据查询器进行序列化,这样,如果你订立数据合同,显示主机结构的模型,你可以把一个实例作为第三参数,并会创建你想要的头盔。

问题回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签