我有一个wcf网络服务,这是启动和运行。我还有一个visual studio 2012。我尝试按照以下教程在控制台应用程序中使用wcf wcf服务:
http://www.csharptutorial.in/2012/01/cnet-how-to-consume-wcf-web-service-in.html#.UxxME_6x6JA
第一步之一是运行这个SvcUtil.exe命令:
微软“C:\Program Files\C:\WcfFiles> SDKs\Windows\v6.0A\Bin\SvcUtil.exe”http s://service.mycompany.nl/PortalService.svc?wsdl
我得到了这个错误:
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'https://service.mycompany.nl/PortalServic
e.svc?wsdl' using WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot obtain Metadata from https://service.mycompany.nl/PortalService.s
vc?wsdl
If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess. For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: https://service.mycompany.nl/PortalService.svc?wsdl
Metadata contains a reference that cannot be resolved: 'https://service.mycompany.nl/PortalService.svc?wsdl'.
The HTTP request is unauthorized with client authentication scheme 'Anonymou
s'. The authentication header received from the server was 'Basic realm="service
.mycompany.nl"'.
The remote server returned an error: (401) Unauthorized.
HTTP GET Error
URI: https://service.mycompany.nl/PortalService.svc?wsdl
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'https://sehapp01.dmz.rubicongroup.local/SEHP
ortalService.svc?wsdl=wsdl0'.
- The underlying connection was closed: Could not establish trust relationship
for the SSL/TLS secure channel.
- The remote certificate is invalid according to the validation procedure.
If you would like more help, type "svcutil /?"
C:\WcfFiles>发布于 2014-03-09 19:34:35
尝试使用WcfTextClient来使用Wcf。
位于以下路径: C:\Program Files (x86)\Microsoft Visual Studio11.0\Common7\IDE
在那里你会找到WcfTestClient。
打开它,运行您的Wcf,然后在WcftextClient中启动服务,在那里您将能够消费和调用方法;)
https://stackoverflow.com/questions/22281597
复制相似问题