使用ASP.NET 3.5中的ASMX文件的WS-Security [英] WS-Security using the ASMX file in ASP.NET 3.5

查看:70
本文介绍了使用ASP.NET 3.5中的ASMX文件的WS-Security的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我需要设置我的ASMX文件,以便在浏览器中将其拉出以显示WebMethod规范时,Soap Header符合以下格式:

Basically I need to setup my ASMX file so that when I pull it up in a browser to display the WebMethod specification the Soap Header conforms to this format:

<soap:Header>
   <wsse:Security>
      <wsse:UsernameToken wsu:Id='SecurityToken-securityToken'>
         <wsse:Username>Username</wsse:Username>
         <wsse:Password>Password</wsse:Password>
         <wsu:Created>Timestamp</wsu:Created>
      </wsse:UsernameToken>
   </wsse:Security>
</soap:Header>

背景故事:我正在与已构建(并由另一公司拥有)的客户端应用程序集成.基本上,此客户端应用程序已经通过与其他公司的过去集成来设置其肥皂消息.因此,我们选择仅使用与已设置为使用的WSDL相匹配的ASMX文件来构建Web服务.

Back-story: I'm integrating with a client application that is already built (and owned by another company). Basically this client application already has their soap messages all set up from its past integrations with other companies. So we've opted to just build a web service using an ASMX file that matches the WSDL that they're already setup to consume.

是否有可能让WS-Security处理ASMX文件,还是ASMX过于简单,我必须升级到WFC(我真的不想这么做)?

Is it possible to get WS-Security working on an ASMX file or is ASMX too simplistic and I have to upgrade to WFC (which I really don't want to do)?

推荐答案

您可以使用经典的Web服务来实现SOAP/WS-Security服务.这是MSDN上的教程.

You can implement a SOAP / WS-Security service using classic web services. Here's a tutorial from MSDN.

在WCF中,所有这些操作都比较容易.

All of this is easier in WCF though.

拉了错误的链接. 这是我要粘贴的那个(尽管使用WSE 2的CodeProject教程WSE 3是最新版本,我仅在WCF之前使用过该版本.

Pulled the wrong link. Here's the one I meant to paste (CodeProject tutorial that uses WSE 2, though WSE 3 is the latest release and I have used that exclusively pre-WCF).

这篇关于使用ASP.NET 3.5中的ASMX文件的WS-Security的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆