.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

With Anonymous access disabled, is there any way to use an AJAX-enabled WCF Service?

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :WCF
I have a website where anonymous access is disabled but I want to user an ajax-enabled WCF service. Configuring the service's binding security to use "TransportCredentialOnly" with clientCredentialType="Windows" seems like the obvious thing to do; indeed, many posts in various places suggest this approach. Unfortunately, however, it doesn't work. I always get the error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service." How can I configure the service to function correctly. I'm running IIS 7.5 with .Net framework 4.0. Thanks.

View Complete Post

More Related Resource Links

Anonymous Access & Web Service Errors

Getting errors on all my InfoPath web services now that I've enabled Anonymous Access at the Web Application level -- not on the Site Collection itself (the other Site Collection is Anon enabled). I found this thread in the pre-Sharepoint 2010 forums. http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/14d2c1c2-32d4-430b-a191-c01e1ade52fa Does anyone know which parameters or changes I need to make in 2010? Many thanks...

Adding AJAX-enabled WCF Service to the Solution throws an error

Hi I am just trying to learn Ajax enabled WCF service, when I try to create a new web application and add new item "AJAX-enabled WCF Service" I get an error message that "The extension of type 'System.ServiceModel.Configuration.WebScriptEnablingElement, System.ServiceModel.Web, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not registered in the extension collection 'behaviorExtensions'. I had .net2.0/VS2005 and then I installed VS2008. I thought it might be an issue with Machine.config. So I am attaching my machine.config info. <?xml version="1.0" encoding="UTF-8"?>    <!--    Please refer to machine.config.comments for a description and    the default values of each configuration section.     For a full documentation of the schema please refer to    http://go.microsoft.com/fwlink/?LinkId=42127     To improve performance, machine.config should contain only those    settings that differ from their defaults.    -->    <configuration>      <configSections>    <section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=, Culture=neutral, Publi

Problem when ajax enabled WCF Service returns EDM Objects

Hi there, Could you please help me with the following problem? - I have ajax enabled WCF service. It returns Customer Entity Type.  For example: [OperationContract]             public List<Customer> GetCustomers()        {            using (NorthwindEntities context = new NorthwindEntities())            {                return context.Customers.Take(10).ToList();            }        }  - But AJAX Client Library cannot display Customer( as Entity). I cannot see data in browser. Even it hits the breakpoint and returns 10 customers. - But if I make a plain class called "Customer2" with same fields and copy all the "Customer" into "Customer2" then it works. In this case I return List<Customer2>. Then it works like a champ and I can see customer in AJAX/DataView/List. - Why I need to create a class? Is this JSON problem? DataView accepts JSON data format. - I use VS2010, AJAX 4.0. - Do I need to add something else along with [OperationContract].   Regards, Rajan  

How to view AJAX-enabled WCF service (.svc) file in browser

Hi I have created an AJAX-enabled WCF project TestWCFAjax having Default.aspx that uses the Add.svc web service.  When I select Default.aspx and run the app in VS 2008. It works perfectly, calls the webservice to do the desired task. But, I have following questions: 1. When I select the Add.svc.cs and run through VS2008, it throws an error "The type 'TestWCFAjax.Add', provided as the Service attribute value in the ServiceHost directive could not be found.". And the web url on the browser points to http://localhost:4960/Add.svc. I didn't create any virtual directory. I tried creating one that points to my application folder - TestWCFAjax. Still it doesn't work. How can I view Add.svc service on the browser like what we can do with normal WCF service? 2. How can I use Add.svc (AJAX-enabled WCF Service) in another web application? Regards

Users can access every new library though Anonymous access id disabled


Hi guys,

I have a really strange stuff going on... I have Anonymous acces disabled on my MOSS portal in Central Administration:

Central Admin->Application Management->Authentication Providers->Default-> Anonymous Access is checked off


So I doesn't even have an option to enable it on any sites of this web application. But when I create a new Document Library all users have read permissions to it though I left only System Account at library permissions .

Am I missing something?

How to get web service address in a ajax enabled page to use it in javascript


Hii everyone,

I have a requirement where I am using web service from  a server and adding that to a client

website .I have referenced the web service in my client web site  but not able to get the

address of web service. When I click on the path I get the disco file of web service and

the result is not displayed.My code is like this

</p><p>&lt;script&nbsp; language="javascript"&gt;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function btnadd_Click() {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var x = document.getElementById('txtA').value;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var y = document.getElementById('txtB').value;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ans = WebService.Add(parseInt(x), parseInt(y), OnComplete, OnTimeOut, onerror);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }


Web script enabled service - AJAX problem


I have the following REST GET service which is web script enabled using <enableWebScript /> attribute in Web.config.


[WebInvoke (Method ="GET" , BodyStyle =

Getting intellisense to work in VS 2010 for a ajax-enabled WCF Service


Hi all,

I'm experimenting with WCF services inside of a test project.  I have seen documentation on various blogs etc. that tell me that Intellisense is available for WCF services that I write.  However, I cannot get this intellisense to work in VS 2010.  I have tried the same simple steps in VS 2008 and can get intellisense working.

Has something changed here?  Is there a chance I am doing something wrong?

I create a new web application project.
I add an ajax-enabled WCF Service.
I add the script manager control to the page and then reference my wcf service.
When I go to create an object proxy to the service the intellisense is not available.
I know my code is working because I tested it.  It can call the web service and gets the expected result.  Just no intellisense.

I've also tried referencing intellisense from a separate .js file using the following technique:
/// <reference path="MicrosoftAjax.js" />
/// <reference path="MyService.svc" />

This has also not worked.  I have verified that my pathing information etc. is correct. 

Anyway, this is driving me nuts so I'm hoping somebody can shed some light on this.

AJAX enabled WCF Service Question


From a pure html/javascript (jquery)/ajax client I need to access a WCF Service. For this reason I (probably) need to create an AJAX enable WCF Service.
Should I create an ASP.NET empty web application project and in this project add an AJAX enabled WCF Service or should I create an WCF Service Appication or WCF Service Library project and add in one of these projects my AJAX enabled WCF Service?



Ajax enabled WCF Service stops working with Undefined error


 I have an Ajax Enabled WCF service that I call from Javascript.  It works fine, but often after I make unrelated changes to the website it will fail and Javascript will report an 'Undefined' error.  I can easily fix it by deleting the service, removing the system.serviceModel section of the Web.config and then recreating the service.  I don't have to change any of the references in the .aspx or .js files.  Also, the replacement service has identical code in the .config, .cs and .svc files (I don't see any differences).  This morning, I only made some cosmetic changes and the service stopped working again. 

Any insight into what I am doing wrong?

Access Services are not enabled on the service or ....


I am trying to publish from Microsoft Access to Access Services on Sharepoint 2010. I am getting the following error.

“http://win-rprsdfkljs:33332/team/SitePages/Home.aspx/ “did not respond.  Either the server does not exist, Microsoft Access Services are not enabled on the server, or the server is using an older version of Microsoft Access Services that is not compatible with Access 2010.

I am not sure but I don't think Access Services are enabled because I don't see it listed in the "Service Applications" section of SP 2010 CA.  the list of Items it shows is:

  • Application Discovery and Load Balancer Service Application  Application Discovery and Load Balancer Service Application Started
    Application Discovery and Load Balancer Service Application Proxy_64033b8a-805d-4bb7-9ee7-8cdf22c6f9ac  Application Discovery and Load Balancer Service Application Proxy Started
    Application Registry Service  Application Registry Serv

Ajax Enabled Gridview using JavaScript in ASP.NET

Before explaining the article, I would like to thank all readers who read my article and voted for it. Your appreciation for my article gives me strength to write more good articles. Hope in future I will get your valuable comments and suggestions. Now I won't waste your time and come back to the topic. I have written this article on 'Ajax Enabled Gridview Using JavaScript in ASP.NET'. In this article, I will show you how to make a Gridview using a simple HTML table, JavaScript and XML HTTP for Ajax call without using any ASP.NET control.

Using Code

Cutting Edge: Building A Secure AJAX Service Layer


This month Dino builds a service layer that authenticates users of Silverlight 2 and ASP.NET AJAX services to prevent illegal access to sensitive back-end services.

Dino Esposito

MSDN Magazine September 2008

Extreme ASP.NET: Client-Side Web Service Calls with AJAX Extensions


Microsoft AJAX Library and the ASP.NET 2.0 AJAX Extensions provide a number of compelling features ranging from client-side data binding, to DHTML animations and behaviors. Learn all about them here.

Fritz Onion

MSDN Magazine January 2007

Access To Web Service !


Hello ,

I have an Web service,that is call with jquery .

now i neccessary limit access to it .

for Example if everybody type address or ... show an "Access denied" text ...

in fact only my site can call web service and client not allow to call it .

please help me , its very Necessary ...

thanks a lot

Separate sessions in browser tabs together with an ajax enabled web site


I want my tabs in my browser to have separate sessions. I  was told to use

<sessionState mode="InProc" cookieless="UseUri"></sessionState> in web.config

 but when I read about it here: http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=VS.100).aspx

the text says "When you configure an AJAX-enabled ASP.NET Web site, use only the default value of UseCookies for the cookieless attribute. Settings that use cookies encoded in the URL are not supported by the ASP.NET AJAX client script libraries."

I'm using Ajax so are there any ideas what I can do about this problem.

How to set anonymous access to IIS 7 from web config file im using asp.net 2.0 C#

HiI have developed asp.net 2.0 website with crystal report now what my problem is whenever i go to crystal report page its by default going to login.aspx or default.aspx though i didt set any login to my asp.net page..I talk with my hosting provider they said that the asp.net impersonate is enable..I think in IIS 7 authentication if i set anonymous access enable, will it work fine?so i need to know how to enable anonymous access from my webconfig ..so please let me know how to do?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend