2009-12-08 76 views
0

我正在從本地主機:2971上的項目工作,並在母版頁中我想包括一個asp:ScriptReference到一個wcf服務我託管在IIS本地主機:5152WCF:引用腳本管理器問題的服務

<Services> 
     <asp:ServiceReference InlineScript="false" Path="http://localhost:5152/CostService.svc" /> 
</Services> 

然後我嘗試撥打:

var service = new SandwichServices.CostService(); 
    service.CostOfSandwiches(5, onSuccess); 

從母版頁繼承的頁面上。

然而,在firefox的錯誤控制檯我得到如下:

Error: no element found 
Source File: http://localhost:2971/CostService.svc/CostOfSandwiches 
Line: 1 

那麼,爲什麼在源文件指向2971? 服務工作正常我在2152年創建的示例頁面。

任何人都知道怎麼了? 任何幫助將不勝感激!

<!-- 
[EndpointNotFoundException]: The service '/CostService.svc' does not exist. 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() 
[HttpException]: The service '/CostService.svc' does not exist. 
    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) 
    at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) 
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
--> 

回答

0

我認爲你正在開發使用卡西尼(Web服務器內VS)。您需要兩個卡西尼實例才能訪問您正在討論的兩個端口。如果是IIS,則不需要portnumber。

+0

我正在使用IIS。 – ErnieStings 2009-12-08 19:01:18

+0

你可以獨立測試你的WCF嗎? – Perpetualcoder 2009-12-08 23:32:53

+0

是的,我可以。沒問題 – ErnieStings 2009-12-09 13:01:26