Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get intellisense for WCF Ajax Services?
    text
    copied!<p>I've finally got Intellisense working for JQuery by applying patch KB958502 to Visual Studio 2008 and including this line:</p> <pre><code>/// &lt;reference path="JQuery\jquery-1.3.2.js"/&gt; </code></pre> <p>at the top of my .js files. Now I'm trying to figure out how to get JavaScript intellisense for the client proxies generated by the ScriptManager's ScriptReference elements (as shown here):</p> <pre><code> &lt;asp:ScriptManager ID="ScriptManager1" runat="Server" EnablePartialRendering="false" AsyncPostBackTimeout="999999"&gt; &lt;Services&gt; &lt;asp:ServiceReference path="../Services/DocLookups.svc" /&gt; &lt;/Services&gt; &lt;/asp:ScriptManager&gt; </code></pre> <p>The client proxies are working -- i.e. I can make calls through them, but I'm getting no Intellisense.</p> <p>My service is defined with a .svc file:</p> <pre><code>&lt;%@ ServiceHost Language="C#" Debug="true" Service="Documents.Services.DocLookups" CodeBehind="~/App_Code/DocLookups.cs" %&gt; </code></pre> <p>The code behind file looks like:</p> <pre><code>[ServiceContract(Namespace = "Documents.Services", Name = "DocLookups")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(IncludeExceptionDetailInFaults = true)] public class DocLookups { ... </code></pre> <p>a sample method in this class is:</p> <pre><code> //Called at the begining of the page to fill in the category list [OperationContract] public SelectOption[] GetCategoriesForSelectList() { SelectOption[] Result; IDocumentRepository repository = new DocumentEntityRepository(ConnectionString); Result = (from cat in repository.GetDocCategories() select new SelectOption(cat.Category_ID.ToString(), cat.CategoryName)).ToArray(); if (Result.Length &gt; 0) Result[0].Selected = true; //Select first item return Result; } </code></pre> <p>and it uses a data contract defined like this:</p> <pre><code>namespace Documents.Services { [DataContract] public class SelectOption { //A useful DTO to use when filling a &lt;select&gt; element with options public SelectOption(string optionValue, string optionText) { OptionValue = optionValue; OptionText = optionText; Selected = false; } public SelectOption(string optionValue, string optionText, bool selected) { OptionValue = optionValue; OptionText = optionText; Selected = selected; } [DataMember] public string OptionValue { get; set; } [DataMember] public string OptionText { get; set; } [DataMember] public bool Selected { get; set; } } </code></pre> <p>}</p> <p>In my javascript files, a call to this service looks like:</p> <pre><code>Documents.Services.DocLookups.GetCategoriesForSelectList(... </code></pre> <p>but I get no Intellisense (for example, if I type Documents. nothing pops up). I don't get intellisense for either the generated methods or the [DataContract] types used by the methods. </p> <p>I believe that I am <strong>supposed</strong> to get Intellisense for these proxies and types, but can't figure out what I might be doing wrong. TIA.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload