具有自定义身份验证和 X509 证书的 SOAP 客户端调用消息
我使用 WCF 构建了一个 Web 服务,并决定使用带有自定义身份验证(我自己的数据库)和 X.509 证书的消息安全性(wshttpbinding)。我想知道客户端如何使用 SOAP 消息调用 Web 服务来验证和使用我的服务。我想知道我应该在肥皂头部分添加什么才能调用我的服务,因为我必须从非 WCF 客户端调用此 Web 服务。
任何帮助将不胜
感激
I built a webservice using WCF and decided to use message security(wshttpbinding) with custom authentication( my own database) and X.509 certificate. I want to know how does client call a webservice using SOAP message in order to authenticate and use my service. I want to know what should I have to add in soap header section in order to call to my service because I have to call this webservice from Non-WCF client.
any helps would be appreciated
regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您想要如何使用证书的方式。您可以使用消息或传输安全,其中传输意味着HTTPS并且具有高度的互操作性消息意味着 WS-Security,您的客户端通常需要使用一些特殊的 API(手动实现 WS-Security 和相关协议是一项艰巨的任务)。所以主要取决于Non-WCF客户端的类型。有许多用于 Java 或 C++ 的 API,还有一些用于 PHP 的 API,但我不知道有任何 API 为 Android、iOS 或 Windows Mobile 提供 WS-Security 功能。
用户名和密码也可以在消息中或通过传输标头传输。前一种方法通常是通过标准化的 UserName Token 配置文件来实现的,该配置文件只是一组预定义的 SOAP 标头(WCF 将为您执行此操作)。这些标头没有什么特别之处,因此即使没有 WS-Security API 的非 WCF 客户端也应该能够轻松使用该服务。后一种方法通常通过基本 HTTP 身份验证来实现,与 HTTPS 一起它可以是最具互操作性的解决方案(但如果您在 IIS 中托管服务并且不想使用 Windows 帐户进行身份验证,则 WCF 站点上可能会遇到一些挑战)。
It depends on the way how you want to use the certificate. You can use message or transport security where transport means HTTPS and it is highly interoperable and message means WS-Security where your clients usually needs to use some special API (manually implementing WS-Security and related protocols is huge task). So it mainly depends on the type of Non-WCF client. There are many APIs for Java or C++ and some for PHP but I'm not aware of any API providing WS-Security features for Android, iOS or Windows Mobile.
User name and password can be also transported either in message or by transport headers. The former approach is usually achieved by standardized UserName Token profile which is only set of predefined SOAP headers (WCF will do this for you). There is nothing special about these headers so even Non-WCF clients without WS-Security API should be able to easily consume the service. The later approach is usually achieved by Basic HTTP authentication and together with HTTPS it can be the most interoperable solution (but there can be some challenges on WCF site if you host the service in IIS and you don't want to use Windows accounts for authentication).