English 中文(简体)
执行 Ws-security within WCF proxy
原标题:implementing Ws-security within WCF proxy

作为服务参考,我已将轴心输入2008年VS项目。

我需要能够通过安全细节,例如用户名/密码和非密码,以称轴线服务。

我已想到这样做是为了大灾难,即理解世界仇恨(在那里没有问题)。

我很少了解世界团结基金的经验,但是,由于社会团结组织,我已努力如何把最终点打到实处,但对于如何建立SapHeaders没有想法,因为以下图象显示:

<S:Envelope 
  xmlns:S="http://www.w3.org/2001/12/soap-envelope"
  xmlns:ws="http://schemas.xmlsoap.org/ws/2002/04/secext">
    <S:Header>
        <ws:Security>
            <ws:UsernameToken>
                <ws:Username>aarons</ws:Username>
                <ws:Password>snoraa</ws:Password>
            </ws:UsernameToken>
        </wsse:Security>
        •••
    </S:Header>
    •••
</S:Envelope>

任何帮助

感谢马克

问题回答

为了称呼这类服务,你通常使用basicHttpBled。 (SOAP 1.1, 不含WS-* 执行)或wsHttpBled(SOAP 1.2, WS-* 执行)。

主要问题是所有的安全参数都正确。 我有类似的网络服务(以贾瓦语为基础),我需要使用——这里是我的背景和守则:

app./web.config

<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding name="SoapWithAuth" useDefaultWebProxy="false">
            <security mode="TransportCredentialOnly">
              <transport clientCredentialType="Basic" proxyCredentialType="None" realm="" />
            </security>
         </binding>
      </basicHttpBinding>
   </bindings>
   <client>
    <endpoint name="SoapWithAuth"
                  address="http://yourserver:port/YourService"
                  binding="basicHttpBinding" 
                  bindingConfiguration="SoapWithAuth"
                  contract="IYourService" />
   </client>
</system.serviceModel>

之后,在您的客户称职时,你需要这套法典:

IYourServiceClient client = new IYourServiceClient();

client.ClientCredentials.UserName.UserName = "username";
client.ClientCredentials.UserName.Password = "top-secret"; 

这是否有助于?

世界路德会联合会客户代理人不支持密码摘要选择。 这样做的唯一办法是建立用户名称Token yourself,然后在发出电文之前将其注入SOAP的负责人。

我还有一个类似的问题,即:here,应当足以帮助你解决同一问题。

最后,我使用了旧的WSE3.0图书馆,供用户名Token使用,而不是把洗.算法本身编码,然后使用习惯行为来改变SOAP的头盔。





相关问题
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. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签