我在開發機器上構建了一個WCF Web服務。我構建了這個服務,創建了一個測試客戶端,測試了一切,並且它工作正常我開始對這個WCF的東西感覺很不錯。然後我大膽地將它移到我的生產服務器上。操作方法:將WCF服務從本地主機移動到生產服務器
現在,生產服務器位於WinHost.com上。我有我的測試域www.MyDomain.com,創建了一個應用程序文件夾/ websvc,並將該Web服務文件複製到其中。服務地址是http://www.MyDomain.com/websvc/eval.svc
現在我已經轉移到生產服務器,我無法使用Web服務。我得到這個錯誤 - 「這個集合已經包含一個地址與方案http。」我搜索瞭解決方案的信息,嘗試了一些,但這隻會導致其他錯誤。所以我重置了一切,我重新開始。
根據上面的服務地址,我的web.config應該是什麼樣子?具體來說,我的終端應該如何查看它?
這是我現在有...
<configuration>
<system.serviceModel>
<services>
<service name="EvalServiceLibrary.EvalService">
<endpoint address="http://www.MyDomain.com:80/websvc/mex"
binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="http://www.MyDomain.com:80/websvc/basic"
binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
這是您嘗試從應用程序使用服務時獲得的消息嗎?啓用'includeExceptionDetailInFaults',然後在瀏覽器中導航到服務*的位置。*它顯示了什麼?順便提一下,您在問題中列出的地址與Web.config文件中的端點地址不匹配。 – Jay 2010-01-25 02:11:20
您能指出端點地址的區別嗎?我沒有看到它。當我嘗試訪問http://www.MyDomain.com:80/websvc/eval.svc/basic – DenaliHardtail 2010-01-25 02:28:20
時,錯誤消息在我的瀏覽器中消失了。描述中的地址是「websvc/eval.svc」,而在它被稱爲'basic'。 – Jay 2010-01-25 06:28:47