问题标签 [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 回答
984 浏览

.net - 使用 WSHttpBinding 时如何限制对本地机器的 WCF 服务的访问?

我正在使用 WCF 在我的机器上使用 WSHttpBinding 进行进程间通信,并且我想限制该服务,以便只有当前机器上的进程可以调用该服务。我怎样才能做到这一点?

我更喜欢使用 NetNamedPipesBinding,它本质上会执行此限制,但是这在我的场景中是不可能的,所以我想要一种使用 WSHttpBinding 来限制它的方法。我不能使用 NetNamedPipesBinding 的原因是该服务的一个客户端正在低完整性进程(处于保护模式的 Internet Explorer)中运行,并且无权连接到更高完整性的命名管道(没有很多像这样看起来不错但我宁愿避免的无证玩游戏)。

一种选择是添加一个 IDispatchMessageInspector,它按此处所述的 IP 地址进行限制。这是最好的方法吗?

更新:该软件将部署到数百台机器上,因此使用证书之类的解决方案可能比预期的要多。

0 投票
3 回答
5119 浏览

wcf - 如何使用 Delphi 2010 导入 https 网络服务 (wcf)?

我有一个问题,所以我想从你那里得到帮助。有一个网络服务,它的网址:https ://kps.saglik.gov.tr/Services/KPSTestServices.svc

我们可以在 Visual Studio C# 上轻松导入这个 url,但我们无法在 delphi 2010 上导入它。

我们也有来自 saglik.gov.tr 的用户 ID 和密码,但结果相同:无法导入此服务。我们现在能做什么 ?

感谢您目前的任何想法。

Visual Studio 示例:https ://kps.saglik.gov.tr/kps_ornek1.zip


我能够将文件导入本地硬盘录制。

当我调用 service 时,现在我收到 https 连接失败错误。

WCFStorm 创建的 XML (http://www.wcfstorm.com/wcf/home.aspx)

响应 XML

德尔福 2010

我的请求

没有 XML

我的回复

没有 XML

0 投票
1 回答
1605 浏览

c# - 使用证书在 IIS 中保护 WCF 服务

我想使用自签名证书(由 inetmgr 生成)保护 WCF 4 中的服务应用程序。

但是,我不能。当我调用服务的方法时,我有一个 MessageSecurityException:

客户端身份验证方案“匿名”禁止 HTTP 请求。

web.config文件:

我尝试使用该服务的代码是:

SSL配置:

SSL 设置

0 投票
2 回答
1323 浏览

.net - 如何在服务根地址(不带斜杠)托管 WCF REST 服务?

我有一个在地址上使用 wsHttpBinding 托管的服务(主机基地址是http://localhost/MyService)。

在我的合同 ( IMyService) 中,我有:

如果我运行我的服务并浏览到http://localhost/MyService/,它工作正常。如果我浏览到http://localhost/MyService,我会看到一个默认的 WCF 页面,表明没有为此服务启用元数据发布服务。

我尝试了 UriTemplate 的各种组合:

  • UriTemplate = ""
  • UriTemplate = "/"
  • UriTemplate = "*"

结合服务基地址:

它们都产生相同的行为。在以前的某个时候,我可以发誓这是有效的,尽管我认为我可能一直在使用 UriTemplate 中的子路径。我知道如果我有一个“/abc/123/”的 UriTemplate,我可以浏览到 /abc/123(没有尾部斜杠),因为 WCF 实际上会自动发出 HTTP 307 重定向。

我正在使用 .NET 4.0。

0 投票
1 回答
2299 浏览

wcf - WCF wsHttpBinding with certificate message security

I am trying to create client and service applications with Message security with Certificate. But I have some errors all the time and can't make it work. Could somebody suggest what is wrong with my configuration files?

This is the service configuration:

and this is the test client configuration

the current exception I have is:

System.ServiceModel.ServiceActivationException: The requested service, 'http://wcftest.pvt/SecuredCommunication/Service1.svc' could not be activated. See the server's diagnostic trace logs for more information.

For me configuration looks ok, I created it using some manuals from MSDN, so I can't understand what is wrong. I installed certificate using makecert.exe tool like this

makecert.exe MakeCert -pe -ss My -sr LocalMachine -a sha1 -sky exchange -n CN=wcftest.pvt

Thanks, Alexander.

0 投票
1 回答
10856 浏览

wcf - 合同需要 Session,但绑定 'WSHttpBinding' 不支持它或未正确配置以支持它

我已指定服务合同要求会话。

服务装饰如下:

这是我的 App.config 文件:

当我按 F5 时,我收到错误消息“合同需要会话,但绑定 'WSHttpBinding' 不支持它或未正确配置以支持它。”

我真的需要支持 SSL 并且需要会话的通道。

0 投票
1 回答
389 浏览

c# - 使用 WCF、WSBinding 发送字典

我目前正在尝试使用 WCF、WShttpBinding 在 winform 应用程序中创建 Web 服务。其中一种方法返回字典。客户端,RTD 服务器将调用此方法来检索字典。

由于某种原因,当字典变得太大(0.6MB +)时,会抛出通信异常。我已经尝试在客户端和服务器端增加以下参数的大小,但它仍然不起作用。有人可以告诉我我做错了什么吗?谢谢。

0 投票
1 回答
4343 浏览

wcf - wsHttpBinding 消息安全

我有一个像这样的 wsHttpBinding

如果只有 NTLM 可用,

这是否意味着 WCF 将通过 SOAP 消息发送客户端的凭据?

此配置是否与 ws-security 兼容?

谢谢

0 投票
3 回答
1657 浏览

wcf - WCF MaxArrayLength 更改设置不会保留

我正在尝试使用 WCF 上传文件。低于 16K 的所有内容都可以正常工作,但任何超出的内容都会引发此错误:

反序列化 System.Byte[] 类型的对象时出错。读取 XML 数据时已超出最大数组长度配额 (16384)。可以通过更改创建 XML 阅读器时使用的 XmlDictionaryReaderQuotas 对象的 MaxArrayLength 属性来增加此配额

这是我的 WCF 服务 app.config

这是我的客户端 app.config

任何帮助深表感谢!谢谢。

0 投票
1 回答
268 浏览

asp.net - WCF 身份验证流程

我正在从 ASP.NET 应用程序调用 WCF 服务。由此,我正在使用 WSHTTPBinding 访问 WCF 服务。我可以从HttpContext.Current.User.Identity.Name. 我希望能够将其传递给 WCF(不使用自定义标头 -肯定有适当的方法来执行此操作。)它必须是 inHttpContext.Current.User.Identity.Name而不是的身份WindowsIdentity.GetCurrent().Name,因为此服务可能会从使用的 ASP.nET 应用程序中使用表单或 Windows 身份验证。据我了解,它应该出现在ServiceSecurityContext.Current.PrimaryIdentity.Name. 我已经搜索了很长时间来试图找到这个问题的答案,但还没有找到。