我有一個在ASP.NET網站還舉辦傳統的ASMX式服務託管新創建的WCF .SVC。調用從客戶端應用程序WCF服務接收EndpointNotFoundException,但沒有錯誤的瀏覽器
如果我調用SVC中包含的單個方法,則會收到以下消息。 「
」在http://localhost/REDACTEDSITE/LicenseVerification.svc
沒有可以接受消息的端點偵聽,這通常是由不正確的地址或SOAP動作引起的,請參閱InnerException(如果存在)以獲取更多詳細信息。
不過,我可以貼上我的本地機器上鍊接到任何瀏覽器,並獲得「這是一個Windows©通信基礎服務。元數據發佈該服務目前被禁用。」頁面。
IIS日誌顯示瀏覽器正在發出GET請求並收到200響應。 WCF客戶端發出POST請求並接收404.0響應。
這些是我使用的最新配置設置。他們有點微不足道。
主機
<system.serviceModel>
<client entries for other services that work>
<services>
<service name="LicenseVerification.svc">
<endpoint address="LicenseVerification.svc"
binding="basicHttpBinding" bindingConfiguration="" contract="Management.ILicenseVerification" />
</service>
</services>
</system.serviceModel>
客戶
<system.serviceModel>
<client>
<endpoint address="http://localhost/REDACTEDSITE/LicenseVerification.svc"
binding="basicHttpBinding" bindingConfiguration="" contract="Management.ILicenseVerification"
name="LicenseVerificationClient">
</endpoint>
</client>
</system.serviceModel>
合同
[ServiceContract]
public interface ILicenseVerification
{
[WebInvoke(Method="GET")] //have tried WebGet()
[OperationContract]
LicenseInfo GetProfileLicenseInfo(string profileName);
}
Servi大街CE IMPL
public class LicenseVerification : ILicenseVerification
{
LicenseInfo ILicenseVerification.GetProfileLicenseInfo(string profileName)
{
ProfileInfo _pi = ProfileHelper.GetRequestedProfileInfo(profileName);
if (_pi == null)
{
return null;
}
return LicenseVerifier.GetLicenseInfo(_pi);
}
}
我曾嘗試重新註冊asp.net 4.0,修理服務模式,重新啓動IIS,搗毀並使用MS服務配置工具重新創建配置文件,並通過手,我仍然不能得到這個上班。
這些是小的請求(幾KB),所以我不認爲它的大小問題。
那伸出的唯一的事情是GET/POST,但是這並沒有對SVC的,我做之前一直是個問題。
我的本地環境的Win7/64,VS2010,.NET 4
請讓我知道什麼嘗試。我把同樣的各種SO帖子剔除了,沒有運氣(甚至是那些看起來明顯不同的)。
你有沒有試過「[WebInvoke(Method =」POST「)]」? – Zachary