2012-03-18 113 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