问题标签 [wshttpbinding]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1539 浏览

wcf - WCF 自托管服务 SSL/传输安全/基本身份验证不要求提供凭据

我创建了一个具有 HTTPS/SSL、传输安全性和基本身份验证的自托管 WCF 服务。出于某种原因,当我在浏览器中运行该服务时,它从不要求提供凭据。怎么了?

服务配置:

HTTP 配置:

0 投票
1 回答
9505 浏览

wcf - 带有证书的程序化 WCF 消息安全性

我已经使用 WSHttpBindings 编写了一个自托管的 WCF 服务,并且我正在尝试使用我自己生成的证书来实现消息级安全性。不幸的是,我得到了一个隐藏的异常(通过服务跟踪查看器),指出“提供给包的凭据未被识别”。

几点注意事项:

  1. 这必须在代码中完成,而不是在配置中
  2. (服务器/客户端)证书是本地机器存储中的证书,在调试时我的用户可以访问私钥。
  3. 我已经用谷歌搜索了这个地狱,并找到了一个很好的资源来设置基于 WCF 消息的安全性here

我不确定我错过了什么。除了创建端点身份之外,这些东西中的大部分似乎都是直截了当的。无论我使用 DnsEndpointIdentities、基于证书的身份还是根本没有身份,它都会失败并显示相同的消息。

谁能指出我正确的方向?

服务器端:

客户端:

0 投票
4 回答
18543 浏览

c# - SOAP 标头操作不被理解

我正在尝试在 C# 中使用 Web 服务。每当我尝试从 Web 服务类调用该函数时,我都会收到“无法理解 SOAP 标头操作”。我添加了指向我项目中的 Web 服务的 Web 参考 [不是服务参考]。采取了以下步骤来添加网络参考

1)右键单击项目->添加WebReference

当我在网络浏览器中检查网络服务时,我在标题中发现了这个

我已经完成了以下代码来调用 Web 服务功能

0 投票
0 回答
557 浏览

wcf - 在 WCF 中使用证书身份验证时出错

我有点酸了!

部署到我在以前的安装中未见过的一台实时服务器时出现以下错误。该服务器位于我们生产环境中的硬件负载平衡器 (BigIP) 后面,据我所知,这是与以前部署的唯一区别。

无法启动模拟,因为来自具有“http://tempuri.org/ISomeService/GetStuff”操作的请求消息的 UltimateReceiver 角色的 SecurityContext 未映射到 Windows 标识。

我们在经典模式应用程序池中运行 Windows Server 2008 R2 (IIS 7.5)、WCF 4.0。

以下是我认为是我的配置文件中的相关片段——可能有一些拼写错误,我更改了名称以保护有罪者:

任何帮助将不胜感激。

0 投票
0 回答
410 浏览

vb.net - 从 ObjectDataSource Select 方法调用 MVC 服务时发生 CommunicationException

我的 Web 应用程序出现以下异常:“通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为它处于故障状态”堆栈跟踪:

" 服务器堆栈跟踪:在 System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 在 [0] 处重新引发异常:在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 在 System.Runtime。 Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.ClientBase1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) at System.ServiceModel.ClientBase1.Close() 在 System.ServiceModel.ClientBase`1.System.IDisposable.Dispose() 在 System.Web.UI.WebControls.ObjectDataSourceView.ReleaseInstance(Object instance) 在 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect( DataSourceSelectArguments 参数)在 System.Web.UI.WebControls.ObjectDataSource.Select() 在 BudgeteerWeb.EditTransaction.Page_Load(Object sender, EventArgs e) 在 C:\Develop\Budgeteer\BudgeteerWeb\BudgeteerWeb\MemberPages\Transactions\Edit.aspx。 VB:第 27 行"

我从 ObjectDataSource 使用的选择方法中调用 WCF 服务。如果我不使用基于消息的安全性,一切正常。但是,一旦我使用 ClientCredentials 打开 wsHttpBinding,就会出现上述错误。不知道我错过了什么。

ASP 代码:

后面的代码:objectDataSource select 方法使用的函数:

提前致谢。

0 投票
1 回答
426 浏览

wcf - WCF 身份验证 - 验证用户/通过一次,然后以其他方式进行身份验证?

基本上,我有以下场景和信息:

  • 我们正在使用 HTTPS。
  • 我们希望在用户首次登录时通过用户/密码对用户进行身份验证。
  • 在他们通过身份验证后,我希望将来对其他服务(不是登录服务)的任何调用都使用用户名和某种会话(以防密码在会话中间发生变化)。
  • 我想确保我的会话可以超时并以某种方式控制它们,如果用户尝试调用服务并且他们没有会话,他们会收到错误(因为他们没有登录)。不确定是否有 WCF 内置方式来以这种方式进行会话,或者我是否必须使用数据库进行自定义。
  • 我认为我们想使用 WSHttpBinding(不是 BasicHttpBinding),90% 的肯定。

我似乎无法弄清楚如何做到这一点。很多时候,我会找到有关客户端代码执行client.ClientCredentials.UserName.UserName = usernameclient.ClientCredentials.UserName.Password = password. 但是,这不起作用,因为我的服务器检查的是什么?我正在尝试获取该信息并根据用户/通行证数据库对其进行验证。我不打算使用 Windows 身份验证或那种(因为我不关心谁登录到计算机,只关心谁登录到应用程序)。

0 投票
1 回答
1493 浏览

c# - 在 wcf 中启用与 wsHttpBinding 的会话

我写了这段代码:

界面:

服务:

网络配置: 在此处输入图像描述

为什么 UserFullName 总是为空?

0 投票
2 回答
251 浏览

wcf - 使用 wcf wshttpbinding 的内存异常

我有一个将文件上传到服务器的应用程序。我正在使用 nettcpbinding 和 wshttpbinding。当文件大于 200 MB 时,出现内存异常。解决这个问题,我看到人们推荐流式传输,当然它适用于大文件(>1GB)的 nettcpbinding,但是当使用 wshttpbinding 时,方法是什么?我应该更改为 basichttpbinding 吗?什么??谢谢。

0 投票
1 回答
611 浏览

c# - 无法使用基本身份验证访问 WCF Web 服务

我正在尝试配置 WCF 服务以允许 Windows/NTLM 和基本身份验证。不幸的是,鉴于此配置,只有 Windows/NTLM 有效,基本身份验证失败,http 状态代码为 401 Unauthorized

我们的 IIS 7.5 服务器配置为允许这两种类型的身份验证。 在此处输入图像描述

以下阻止基本身份验证工作的配置有什么问题?

我也尝试过使用basicHttpBinding,因为论坛帖子表明,如果 WCF 认为密码是以明文形式传递的,则wsHttpBinding可能会阻止基本身份验证。

0 投票
0 回答
1398 浏览

c# - 使用 wshttp 绑定时的 system.service.security 错误

当我尝试从基于 Windows 的应用程序的客户端应用程序访问我的 Web 服务时出现以下错误

System.ServiceModel.Security.SecurityNegotiationException:无法打开安全通道,因为与远程端点的安全协商失败。这可能是由于用于创建通道的 EndpointAddress 中缺少或错误指定了 EndpointIdentity。请验证 EndpointAddress 指定或暗示的 EndpointIdentity 是否正确标识了远程端点。---> System.ServiceModel.FaultException:安全令牌请求包含无效或格式错误的元素。在 System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(消息消息,EndpointAddress 目标)在 System.ServiceModel.Security.IssuanceTokenProviderBase`1.ThrowIfFault(消息消息,EndpointAddress 目标)在 System.ServiceModel.Security.SspiNegotiationTokenProvider。

服务器堆栈跟踪:在 System.ServiceModel.Security.IssuanceTokenProviderBase 1.DoNegotiation(TimeSpan timeout) at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.TlsnegoTokenProvider.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory1.ClientSecurityChannel 1.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout) at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout) 在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 在 System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan超时)在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan 超时)在 System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan 超时,CallOnceManager 级联)
在 System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout) 在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 在系统。 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 消息) 处的 ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

我也在使用 ASP 会员提供程序....

在过去的几个小时里,我一直试图让它工作,但我一无所获......有趣的是,该应用程序可以在本地机器上运行,但不能在远程机器上运行

谢谢

{

}