我已經選擇了一個我幾個月沒碰過的項目,我使用這個項目學習了WCF,當我在Visual Studio中運行它時,它打開了一個頁面,允許我獲取生成的WSDL,並且可以擊中該服務的代碼。這個WCF服務是如何工作的?
但是當我在看的Web.config旁邊有沒有信息有:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- 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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
沒有服務端點或任何東西,但它(至少在Visual Studio)運行正常,這是怎麼加工?
您可以在代碼中或通過配置文件配置WCF。你是否真的在代碼中配置你的服務? – Chris
不,沒有配置,只有一個.svc文件,裏面有3個方法。 –
在這種情況下@vcsjones是正確的,你運行WCF的默認值。 – Chris