2012-03-18 68 views
0

我有一个服务在iis 7托管,在windows7时,当我输入的网址 http://192.160.11.13/Employee/Service1.svc 我可以看到下面的信息。在wcf服务无法获得wsdl

svcutil.exe的http://192.160.11.13/Employee/Service1.svc?wsdl

This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example: 

C# 

class Test 
{ 
    static void Main() 
    { 
     Service1Client client = new Service1Client(); 

     // Use the 'client' variable to call operations on the service. 

     // Always close the client. 
     client.Close(); 
    } 
} 
当我键入要获得WSDL http://192.160.11.13/Employee/Service1.svc?wsdl 我没有得到的WSDL,而不是我收到此错误信息 HTTP错误404所请求的资源

是找不到的。

什么,我缺少在这里,请让我知道,这样我就可以生成WSDL

感谢 王子

+1

你可以发布你的web.config和托管代码的服务? – Jeff 2012-03-18 07:50:17

回答

1

你所得到的错误是HTTP 404,这意味着“未找到文件”。

有可能是这几个原因:

  • 服务没有运行
  • HTTPGET不
  • 在web.config MEX终结点未设置web.config中允许
  • 你是不是wusing正确的URL

在你使用SvcUtil工具确保您可以访问WSDL文件ŧ通过浏览器。

+0

OP表示他在IIS中托管,并且他能够浏览到该服务的帮助页面。 404错误很可能是一个不正确的URL。很难说没有看到他的配置文件更明确。 – Tim 2012-03-18 19:15:46