WCF Test client and authentication

强颜欢笑 提交于 2019-12-07 22:05:48

问题


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

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?

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.


回答1:


Do you have a mex endpoint specified in your config?

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.

EDIT:

These links may provide some insight in to the issue:

WCF - Cannot obtain Metadata, but works when the XML Endpoint is removed?

Cannot obtain Metadata from WCF service when using Microsoft WCF Test Client.



来源:https://stackoverflow.com/questions/14817195/wcf-test-client-and-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!