WCF: referencing a service from script manager issue


I'm working from a project on localhost:2971 and in the master page i want to include an asp:ScriptReference to a wcf service i am hosting in IIS at localhost:5152

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

then i attempt to call:

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

on a page that inherits from the master page.

however, in the firefox error console i get the following:

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

So why is the source file pointing to 2971?
the service works fine on the sample page i created on 2152.

Anyone know whats up?
Any help would be much appreciated!

[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)

Best Solution

I would think you are developing using Cassini (Web Server Inside VS). You need two instances of Cassini to have access to the 2 ports you are talking about. If it was IIS the portnumber is not required.