.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

Setting up a Digest Authentication WCF service and consuming it

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :WCF

I have a WCF service that had been using NTLM authentication, but needed to recently switch it to digest authentication. The service is running on both an XP Professional machine, as well as a 2003 Server machine, both experiencing the same issues.


To set-up the digest authentication, I created the following in my web.config servicemodel section:



		<binding name="NtlmConnect" maxBufferSize="147483647" maxBufferPoolSize="147483647"  

View Complete Post

More Related Resource Links

WPF consuming WCF Service with Windows Authentication - Not Working

Hi I am developing a WPF application in .NET 4.0 which calls a WCF Service hosted on the server developed in .NET 4.0. I want to use windows authentication for this purpose and it seems that it is not working and keep on giving me following error. The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via I do not want to use https as this is an Intranet application. The WCF Service inturn calls SQL Server SPs via Entity Framwork 4.0. Following is the Web.Config for WCF Service. <?xml version="1.0"?> <configuration> <connectionStrings> <add name="MsdbEntities" connectionString="metadata=res://*/MsdbModel.csdl|res://*/MsdbModel.ssdl|res://*/MsdbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=lvapxdev\lvw_uat_02;Initial Catalog=msdb;Integrated Security=SSPI;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> <appSettings> <add key="IndexLoaderInstallDirectory" value="D:\Longview\Index Loader\"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"/> <authentication mode="Windows"></authentication> </syst

Web service Windows Digest Authentication


I have created a web service and installed it on web server. I am using that service through client application without Authentication.

For using this service I have added web service reference with public IP of web server, it's working correctly

Note:-Both web server and client application are in same domain.

Now I am implementing the windows digest authentication in web service.But when i add the reference with public IP of web server in client application then Request is Timed Out.(ie.No response from web server within 110 seconds.)

If I add the reference with domain IP then it works correctly.

 Now my question is what is difference between adding reference with Public IP and Domain IP ?

And how it is related to windows Digest Authentication ?

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Service Station: Creating And Consuming Web Feeds


Jon Flanders demonstrates creating and consuming Web feeds with Windows Communication Foundation and AtomPub.

Jon Flanders

MSDN Magazine April 2009

Looking for a simple Service and Console Client REST sample implementing BASIC authentication


Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.

Bizzare behavior of Digest authentication with HttpListener.


While trying to use Digest authentication with HttpListener, I expected it to act fairly close to how Basic does. Basic works fine with no surprises. With Digest, however: 

  1. HttpListener/http.sys driver takes on itself to authenticates user, without even passing request to my code (listener.GetContext() never gets unblocked) so ASP.NET application never has a chance to authenticate the user. I can see responses generated by "Microsoft-HTTPAPI/2.0" with WWW-Authenticate headers. I thought application should have a chance to authenticate the request with Digest user identity in the header. Is it possible to do?
  2. While insisting on Digest-authenticating users on its own, "Microsoft-HTTPAPI/2.0"/HttpListener/http.sys successfully authenticates domain users, but not computer users. I tried user name that includes computer name, realm name, computer name in the FQDN format - nothing works. Why such inconsistency?

Thank you,


Consuming a PHP service.


I'm working with an outside company to impletement their API into our program. Most of their member functions working pretty solid. I get to the one function where I have to pass an associated array to it and this is where it blows up. I create a hash table or namevaluecollection and of course I will get the error(The type System.Collections.Hashtable is not supported because it implements IDictionary.), which can't be serialized.

Is there an easy way to pass this associated array to them? I don't think their api is very flexible, but they seem to think so.

Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

authentication issues using exchange web service within sql CLR functions

Hi Hope this is the right forum for this question, we have a VB assembly we have written to perform simple email functions via calls to EWS. We use a high level user who has rights to impersonate the normal exchange users, and this usually works OK, but what we are seeing is that occasional email messages are being created in the wrong user's draft folders. We belive this is because the impersonating account information is getting overwritten within our code when multiple users access the functions at the same time Example call to the WS is... <Microsoft.SqlServer.Server.SqlProcedure()> _ Public Shared Sub InsertEmail( _ ByVal Impersonate As String, _ ByVal Subject As String, _ ByVal Body As String, _ ByVal ToAddress As String, _ ByVal CCAddress As String, _ ByVal BCCAddress As String, _ ByVal HTMLEmail As Boolean, _ <Out()> ByRef ItemID As String, _ <Out()> ByRef ChangeKey As String) 'ByVal CCAddress As String, _ 'ByVal BCCAdddress As String, _ Using esb As Helper = New Helper(Impersonate) ' Create the CreateItem request. Dim createEmailRequest As New ews.CreateItemType() ' Specifiy how the e-mail will be handled. createEmailRequest.MessageDisposition = ews.MessageDispositionType.SaveOnly createEmailRequest.MessageDispositionSpecified

Consuming a WCF Service using SSL

I have a WCF Web Service that has been created with VS2010 using Framework 4.0.  The service accepts an XML file along with a user and password. The service performs exactly as it should until I turn on "Require secure channel" on the virtual directory.  I was receiving errors relating to the endpoints, however, now I have fixed those issues and receive a different error. I have created a separate web site project to consume the web service, again using VS2010.  When I select the button to invoke the call, I receive "The request failed with HTTP status 404: Not Found". The stack trace is as follows: [WebException: The request failed with HTTP status 404: Not Found.] testservice._default.ws_LoadAOCDataCompleted(Object sender, LoadAOCDataCompletedEventArgs e) in c:\my documents\visual studio 2010\Projects\AOCSvc\testservice\default.aspx.vb:38 testservice.aocsvc.AOCService.OnLoadAOCDataOperationCompleted(Object arg) in c:\my documents\visual studio 2010\Projects\AOCSvc\testservice\Web References\aocsvc\Reference.vb:104 System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback callback, Object state) +73 I am new to web services as well as WCF and Framework 4.0.  Again, the service works correctly until I turn on SSL. Any ideas on what may be "locking" the service?  I have rea

Error in consuming web service using WCF client

Hi, I have consumed an external webservice in my client application using WCF. And every thing works great in my Dev box(XP with IIS5.1) But when the same application is moved to Prod server(Win Server 2003 with IIS6.0) it fails. Below is the exception caught: There was no endpoint listening at http://MyExternalWebServiceUrlWithSessionId could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. And the InnerException is: Unable to connect to the remote server My Config file has the below settings:<system.serviceModel> <bindings> <basicHttpBinding> <binding name="Default_Binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCoun

Unable to call an asmx web service using windows authentication from a Service workflow

Hello, I need to use an existing asmx service from inside my service workflow and I am unable to call it. This asmx service is hosted in a web application with iis set to windows authentication, anonymous is not allowed. I need to send the authentication, only way seems too be using transport for basicHttpBindings. Every time I try to call the service I get an error saying that there is nothing listening to the url of the service generated automatically by VS when I added the Service Reference ? my web config <configuration> <configSections> </configSections> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <protocolMapping> <add scheme="http" binding="wsHttpBinding" bindingConfiguration="WindowsCreds" /> </protocolMapping> <bindings> <basicHttpBinding> <binding name="UtilitiesSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

consuming a web service in silverlight

Hi all,      I am new to silverlight. I have to develop an application where I have to consume a web service http://www.xignite.com/xRealTime.asmx?WSDL to display the real time stock price on a data grid in the silverlight application. Can anyone please tell me if it is possible and if the answer is yes how do I go about it.If the answer is no please tell me what is the best way to display these values using a silverlight application.     

Consuming Web Service. Dynamic WSDL ???

Hi everyone. I'm trying to consume a web service with my asp.net application. I've done the basic procedure of creating proxy classes but it won't work. After I spent hours debugging and talking to network support, I realized that a section within the WSDL was dynamic. The WSDL is located in a url like this: http://service/MyWebService?WSDL In the WSDL I have a section like this:<s0:service name="MyWebService"> <s0:port binding="s3:MyWebServiceSoap" name="MyWebServiceSoap"> <s4:address location="http://server1/MyWebService" /> </s0:port> </s0:service> If I press F5 on the browser, the WSDL shows a different address (only the server changes, actually). The range goes from server1 to server9. I've been informed that this service was hosted with some sort of balance system that redirect the requests amongst different servers according to a number of rules. I was also told that I only needed permission to access the balance server ("service"). So, I actually can't see those other "real" servers. When I generated my proxy classes, WSDL showed a path for server1. When I run my application I get a connection error ponting to the IP of server1. They said they can't give me permission to connect directly to server1 because it would kill the balance system. So, how can I con

Security settings for this service require Windows Authentication but it is not enabled for the IIS

Hosting service in IIS 5.1   Config is set to transport layer security. SSL is installed and configured on the virtual folder and BasicHTTP bidings are being used for connection. Authentication in web.config is set to Windows Authorization in web.config is set to Deny Users="?" and Allow Users="*"   When trying to connect to the service using IE, it throws exception that "Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service. "   Can some one tell me what is missing?   Do I have to set anything in Web.Config?   I need to achieve following using Basic HTTP binding   Transport Layer security (SSL), Windows Domain Authentication, Use  user's Domain identity to impersonate the user in service   Please suggest the settings if any   Thanks

Sesame: Spatial OData on Maps, Service Operations, HTTP Basic Authentication

Sesame Data Browser has just been updated to offer the following features for OData feeds: MapsImproved Service operations (FunctionImport) supportHTTP Basic Authentication supportMicrosoft Dallas support Maps Sesame now automatically displays items on a map if spatial information is available in data.This works when latitude and longitude pairs are provided.Here is for example a map of drinking fountains in Vancouver:This comes from DrinkingFountains in http://vancouverdataservice.cloudapp.net/v1/vancouver, which provides latitude/longitude for each fountain. Here is another example, without latitude/longitude this time: This is a map of the customers from the Northwind database, which are located based on their country, postal code, city, and street address. Service operations (FunctionImport) Support for service operations (aka FunctionImports) has been improved. Until now, only functions without parameters were supported. It's now possible to use service operations that take input parameters. Let's take as an example the GetProductsByRating function from http://services.odata.org/OData/OData.svc.This function is attached to Products, as you can see below: A "rating" parameter is expected in order to open the function: After clicking Open, you'll get data as usual:HTTP Basic Authentication New authentication options have been added: HTTP Basic and Dallas (more

:Connection to the WCf service that has connection name http://mysite/SERVICE/authentication.svc?wsd

Hi, I have developed a custom WCF service which gave the following errors while adding my wcf services to sharepoint 2010 site. Error1:Connection to the WCf service that has connection name http://mysite/Service/Authenticate.svc?wsdl cannot be established. Error2:Connection to the WCf service that has connection name http://mysite/SERVICE/authentication.svc/mex cannot be established Please suggest me. Thanks in advance. Varma
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