本文介绍了没有为WCF WebService生成WSDL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在创建简单的wcf Web服务,并尝试从控制台应用程序使用.

当我尝试执行添加Web引用"时遇到以下错误:

下载"http://machinename.domainname.com/VirtualFolder/MyService.svc"时出错?wsdl'.
无法连接到遥控器服务器
无法建立连接,因为目标计算机主动拒绝了它.


即使我无法在VS 2005的浏览器中查看WSDL文件.也可以使用 machinename.domainname.com 输入url 如果我给本地主机 我可以查看wsdl文件

我尝试通过命令行使用svcutil.exe.我收到相同的错误.

相同的代码在其他计算机上也可以正常工作.

以下是我的配置文件设置.

< system.serviceModel>
< serviceHostingEnvironment aspNetCompatibilityEnabled =="true"/>
<服务>
< ;!-管理员服务->
< service name =" ServiceName" behaviorConfiguration ="returnFaults">
< endpoint contract ="IServiceName" binding =''basicHttpBinding''/>
</service>
</services>
<行为>
< serviceBehaviors>
.< behavior name =" returnFaults"
< serviceMetadata httpGetEnabled ="true"; />
="font-weight:bold">
</serviceBehaviors>
</behaviors>
</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

推荐答案


这篇关于没有为WCF WebService生成WSDL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 00:37