没有为WCF WebService生成WSDL文件 [英] WSDL file is not getting generated for WCF WebService
问题描述
我正在创建简单的wcf Web服务,并尝试从控制台应用程序使用.
当我尝试执行添加Web引用"时遇到以下错误:
下载"http://machinename.domainname.com/VirtualFolder/MyService.svc"时出错?wsdl'.
无法连接到遥控器服务器
无法建立连接,因为目标计算机主动拒绝了它.
即使我无法在VS 2005的浏览器中查看WSDL文件.也可以使用, 如果我给本地主机 我可以查看wsdl文件
我尝试通过命令行使用svcutil.exe.我收到相同的错误.
相同的代码在其他计算机上也可以正常工作.
以下是我的配置文件设置.
< system.serviceModel>
< serviceHostingEnvironment aspNetCompatibilityEnabled =="true"/>
<服务>
< service name =" ServiceName" behaviorConfiguration ="returnFaults">
< endpoint contract ="IServiceName" binding =''basicHttpBinding''/>
</service>
</services>
="font-weight:bold">
</system.serviceModel>
Pls.帮助我解决此问题.
在此先感谢.
感谢,
Antony SJ
Hi,
I am creating simple wcf webservice and try to consume from the console application.
I am getting the following error when try to do "Add Web Refference" from my console application.
There was an error downloading 'http://machinename.domainname.com/VirtualFolder/MyService.svc?wsdl'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it
Even i am not able to view WSDL file in the browser by VS 2005. But instead of machinename.domainname.com giving in the url , If i give localhost i am able to view the wsdl file
I tried using svcutil.exe form the command line. i am getting same error.
Same code is working in other machines. Is there any settings do i need to make in IIS?
Following is my Config file Settings.
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<!-- Admin Service -->
<service name="ServiceName" behaviorConfiguration="returnFaults">
<endpoint contract="IServiceName" binding="basicHttpBinding"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="returnFaults">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Pls. help me to resolve this problem.
Thanks in Advance.
Thanks,
Antony SJ
推荐答案
首先,尝试添加
< endpoint contract =" IMetadataExchange"地址=墨西哥" binding ="mexHttpBinding" />
到您的端点列表,并尝试将svcutil.exe指向
http://machinename.domainname.com/VirtualFolder/mex
祝您好运,
--larsw
Hi,
First, try to add
<endpoint contract="IMetadataExchange" address="mex" binding="mexHttpBinding" />
To your list of endpoints, and try to point svcutil.exe against
http://machinename.domainname.com/VirtualFolder/MyService.svc/mex
or
http://machinename.domainname.com/VirtualFolder/mex
Good luck,
--larsw
这篇关于没有为WCF WebService生成WSDL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!