问题标签 [webhttpbinding]

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 回答
12848 浏览

wcf - 在 WCF 中,对于 webHttpBinding,当服务器使用基本身份验证时,如何在客户端 web.config 中指定凭据?

我有两个 WCF RESTful 服务——“通用”服务是公共的,没有安全性;我打算通过 SSL 使用基本身份验证的“管理员”服务。这是我的服务器端 web.config:

在客户端,我目前有如下代码:

问题是,既然我显然不想硬编码所有这些配置信息,我需要如何在客户端的 web.config 中提供它?我很清楚,绑定元素需要在客户端看起来与在服务器上看起来几乎相同。但是,我在哪里指示分配给 WebChannelFactory 的凭据?

任何帮助和/或见解将不胜感激。

谢谢,史蒂夫

0 投票
1 回答
339 浏览

.net - 是否可以让 webHttpBinding WCF 服务回答二进制?

我执行了这份合同

但是,当我调用实现时,我得到的只是这样的:

我不能删除这个包装器和这个序列化吗?

0 投票
2 回答
2846 浏览

wcf - 传递空参数的 WCF 调用

我有一个正在调用的 WebHttpBinding WCF 服务。我的第一个 POST 方法正确发送对象,但随后对 POST 方法的调用为对象传递了 null。

这是我的服务:

这是我的服务合同:

这是我的服务器配置:

最后是我的客户端代码进行调用:

正如您所看到的,我的客户端代码调用了我的 WCF 服务,并且 insert 方法工作得非常好,我可以在我的数据库中看到持久化的对象。但是在更新时,ObjectDTO 参数为空。如果我加载现有对象并执行更新,它会完美运行。使用 POST 方法对 WCF 服务的后续调用似乎是一个问题。GET 方法没有这个问题。

0 投票
3 回答
7684 浏览

wcf - 使用 webHttpBinding 和安全模式传输向 WCF 服务添加服务引用会导致配置文件不正确

我已经搜索和搜索,但找不到解决方案。似乎遇到这种情况会比较普遍......通过https的WCF REST服务。当我添加服务引用时,所有代理类都是正确的,我可以创建服务中定义的对象、调用服务等。但是,我无法使用代理的客户端类创建配置的客户端。我必须明确地创建绑定、行为和端点并将它们添加到客户端。例如,根据我的所有研究,我应该能够做的是:

并关闭并运行。但是,我要做的是:

为了模仿服务配置:

“添加服务参考”给了我这个:

我相信我无法创建开箱即用的默认客户端与 WsdlImporter 的问题有关。使用 svcutil 时出现类似错误:

我确定这与我的自签名证书有关,但我无法让 makecert 为我提供一个不会导致我的 IIS 崩溃的 CA 的有效证书。

环境详情:VS2008 XP 64bit .NET 3.5 IIS6

在此先感谢您的帮助...

0 投票
0 回答
2138 浏览

c# - WcfRestContrib:是否有任何从桌面客户端使用 WCF REST 服务(具有基本身份验证)的示例

是否有任何使用 WCF REST 服务和来自桌面客户端的基本 HTTP 身份验证的示例?我正在使用 WCF REST Contrib。当从浏览器使用 javascript 客户端时,身份验证工作正常,但当我尝试使用 C# 控制台应用程序时。我收到BasicUnauthorizedException {“您尝试访问安全资源失败。”}。即使我提供了正确的用户名和密码。

任何帮助将不胜感激。

0 投票
1 回答
174484 浏览

wcf-binding - BasicHttpBinding vs WsHttpBinding vs WebHttpBinding

In WCF there are several different types of HTTP based bindings:

What are the differences among these 3?

In particular what are the differences in terms of features / performance and compatability?

0 投票
2 回答
1492 浏览

c# - 是否可以使用 C# WCF WebHttpBinding 创建会话(如 php 会话)?

是否可以使用 C# WCF WebHttpBinding 创建会话?(类似于带有 cookie 的 php 会话等)

0 投票
2 回答
460 浏览

c# - 从 TCP 的角度来看,WCF webHTTPbinding 是什么?

从 TCP 的角度来看,WCF webHTTPbinding 是什么?那么 - 不需要的数据流有多难?与其他 WCF 绑定相比,它有多难?

0 投票
2 回答
185 浏览

c# - 如何通过 WebHttpBinding 接收数组?

会像什么

工作?以及如何为www.example.com/service.svc?ids=1,2,3,4,5,6,7,8请求形成一个链接\url()?

0 投票
1 回答
5339 浏览

wcf - WCF configuration for WebHttpBinding(Restful) for supporting both HTTP and HTTPS

We are using AJAX Cascading dropdown and AutoComplete functionality with Restful WebService Services providing data. With one endpoint(non-secured) eveything was working fine, until we tried same web page with https. Our Webappplication needs to support both. Our of very few articiles/blogs on this issue I found 2 which applies to my requirements.

  1. http://blog.abstractlabs.net/2009/02/ajax-wcf-services-and-httphttps.html
  2. http://www.mydotnetworld.com/post/2008/10/18/Use-a-WCF-Service-with-HTTP-and-HTTPS-in-C.aspx

I followed same pattern, added 2 endpoints, assuming WCF will pickup appropriate endpoint looking at HTTP or HTTPS protocol. Worked like a charm in my dev machine(XP-IIS5) and 1 Server 2003R2(IIS6), however did work in Production server 2003-IIS6. Website in IIS is exact same(including permission etc). The error it throws - Error 500(Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http]..)

Here's the sample configuration(ignore typos)

Any help on this is highly appreciated ?

Thanks KSS