WCF 测试客户端和身份验证 [英] WCF Test client and authentication

查看:74
本文介绍了WCF 测试客户端和身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 WCF 测试客户端调用 Web 服务,但该 Web 服务需要身份验证.

I'm trying to call a webservice with WCF Test Client but the webservice requires authentication.

我如何登录并通过 WCF 测试客户端调用它(我尝试从浏览器获取它然后调用但不起作用).我可以使用 SOAP UI,但如果可能的话,我想用 WCF 测试客户端来做.也许更改 WCF 配置?

How do I log on and call it by WCF Test Client (I tried to get it from browsers and then to call but does not work). I could use SOAP UI, but I'd like to do it with WCF Test Client if is possible. Maybe changing WCF config?

错误:无法从 Windows (R) 获取元数据您可以访问的通信基础服务,请检查您是否已在指定的位置启用元数据发布地址.有关启用元数据发布的帮助,请参阅MSDN 文档位于http://go.microsoft.com/fwlink/?LinkId=65455.WS-元数据交换错误 URI:元数据包含一个不能被引用的引用解决: ''.HTTP 请求未经客户端授权身份验证方案匿名".收到的认证头来自服务器的是基本领域="".远程服务器返回错误:(401) Unauthorized.HTTP GET 错误 URI:
下载 '' 时出错.请求失败HTTP 状态 401:未经授权.

Error: Cannot obtain Metadata from If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: Metadata contains a reference that cannot be resolved: ''. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm=""'. The remote server returned an error: (401) Unauthorized.HTTP GET Error URI:
There was an error downloading ''. The request failed with HTTP status 401: Unauthorized.

推荐答案

你有 mex 端点 在您的配置中指定?

Do you have a mex endpoint specified in your config?

如果您遇到设置问题,我建议您通读Codeplex 应用场景,以确保您已正确设置服务和 WCF 测试客户端.

If you're having setup issues I'd suggest reading through the Codeplex applications scenarios to ensure you have setup your service and WCF Test Client properly.

如果您需要任何进一步的帮助,请发布配置和一些示例代码.

Please post configs and some sample code if you require any further help.

这些链接可能会提供对该问题的一些见解:

These links may provide some insight in to the issue:

WCF - 无法获取元数据,但在删除 XML 端点时有效吗?

使用 Microsoft WCF 测试客户端时无法从 WCF 服务获取元数据.

这篇关于WCF 测试客户端和身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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