views:

302

answers:

2

I have looked up the following article before making this post but my scenario is a little different

http://stackoverflow.com/questions/587350/how-do-i-get-intellisense-for-wcf-ajax-services

I also have the patch applied to VS2008 and have jquery intellisense working.

In my solution, the WCF service is actually not inside the ASP.NET web project. I have a separate projects for ServiceContracts, ServieImplementations and there is a web project that is hosting the WCF service.

My ASP.NET web application is then consuming the WCF service. In my javascript file inside the web application, if I write the following two lines at the top, the intellisense doesn't work. (reqws is the IIS application hosting my WCF service)

/// <reference name="MicrosoftAjax.js" />
/// <reference path="http://localhost/reqws/DataManagementService.svc" />

I have even forced the javascript intellisense update in VS2008 by going to Edit menu and selecting that option. There are no errors being thrown.

Please help. One other thing, I actually created a test WCF service inside my web application itself and placed the following inside my javascript file and this works. So, my problem is how to get intellisense working when the WCF service is not inside the same application or when you are consuming an external service through ScriptManager.

A: 

Scott Hanselman actually sent me this reply to my question: "Try manually pulling out the JavaScript files from the service and referencing those."

Based on his suggestion, I tried generating the js file using http://localhost/reqws/DataManagementService.svc/jsdebug on my machine and saved this inside my web application's script folder.

I referenced that js file from the ASP.NET web application’s script file as follows and the intellisense worked.

/// <reference name="MicrosoftAjax.js" />
/// <reference path="~/Common/Javascript/datamanagementservice_script.js" />

But, every time I change the WCF code, I will have to generate this js and replace the current one and update the jscript intellisense in visual studio. Hopefully, there is a way to simplify this?

you might be interested in my answer.
Sky Sanders
A: 

To get debug/intellisense /// <reference path="http://localhost/reqws/DataManagementService.svc/jsdebug" />

but you will not have much luck if the service outside your root. browser implementations vary but you would generally code to the most restrictive which is same site same port.

If you need to go outside, mirror the external service internally and pull that with scriptmanager or simply use the /jsdebug mapping.

Sky Sanders