.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

ASMX Web Service using Forms Authentication, how to Authenticate into it using WCF Client?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :SharePoint

Hello All, a third party vendor is offering our company a ASMX Web Service which uses Forms Authentication and it's also secured using SSL.

Our Platform is .NET 3.51/WCF/C#. How should I Authenticate my Client into that kind of ASMX Web Service?

Can anyone point any article with sample code or an example how a Client can Authenticate into such ASMX Web Service,

Thanks in advance


View Complete Post

More Related Resource Links

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.

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"

SQL Reporting Service, Cookies and Forms Authentication

Hi, I currently have a instance of SQL Reporting Services that uses custom Forms authentication. When I access the Report Manager through Internet Explorer the Report Manager redirects to my login page, I login and it heads back to the Report Manager and everything works as expected. The problem I'm having is when I use the web service it fails when I call ListItems( ... ). I first create an instance of the service, I then call LogonUser with a username and password, which executes fine, then I call the ListItems which throws an exception similar to: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>  <head>   <title>    SQL Server Reporting Services   </title><meta name="Generator" content="Microsoft SQL Server Reporting Services 10.50.1600.1" /> <meta name="HTTP Status" content="500" /> <meta name="ProductLocaleID" content="127" /> <meta name="CountryLocaleID" content="1033" /> <meta name="StackTrace" content="   at Microsoft.ReportingServices.

WCF Service to WSE Client - Certificate authentication over SSL

I am trying to access a WCF service with a WSE 3.0 client over SSL using certificate authentication.  I can do it over an unsecured channel using a customBinding on the service side using the MutualCertificate authentication mode and the turnkey policy assertion mutualCertificate11Security on the client side.  This breaks when I move it to a production environment accessible only by SSL and either (1) change nothing in the server config file--connection gets refused because it is not https--or by (2) changing the server custom binding to CertificateOverTransport--client errors with this:  System.InvalidOperationException: Security requirements are not satisfied because the security header is not present in the incoming message.

My question is simply, how do I access a WCF service over SSL using certificate authentication?


create proxy client with SvcUtil from service using https+cert authentication


Hi all,

I have build two web services one is wcf hosted in iis and the other one is java web service (jax-ws ri) hsted on tomcat. Both of the services uses https and certificate authentication.The certificates are valid and when I check the wsdl's from the browser I can see them without any warning.

So I want to create a wcf client for the services with svcutil. I have created the necessary config file for svcutil (svcutil.exe.config).

When I try to create the proxy files for the java service (svcutil http://JavaServiceIpAddress/service?wsdl) I receive

"metadata contains a reference that cannot be resolved .

<Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/" >
   <faultcode xmlns:a="http://www.w3.org/2003/05/soap-envelope" xmlns="">a:Client</faultcode>
   <faultstring xmlns="">Cannot find dispatch method for {}</faultstring>

the request was aborted: Could not create ssl/tls secure channel"


When I execute svcutil http://WcfServiceIpAddress/service.svc the proxy and configs file are created smoothly. When I try svcutil http://WcfServiceIpAddress/service.svc?wsdl

"error: cannot obtain metadata from http://WcfServiceIpAddress/service.svc?wsdl


Connection times out when WCF client tries to call WCF service, both in Windows Forms apps



The exception message is: Could not connect to TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

What I am trying to do: a WCF service is self hosted in a Windows Forms application. The WCF client is in another Windows Forms application. Eventually, the client is supposed to run on a computer somewhere out there on the Internet and send messages to the server which is running on my home computer. This is my first attempt at making a remote WCF call.

I have success when server and client either run on the same computer, or are running on different computers attached to my little in-home LAN. When I try to route the client's request via Internet (in preparation for having the client reside out there somewhere) I get the exception reproduced in the first paragraph above after waiting for about 20 seconds.

OS is WinXP Pro with SP3. Using Visual Studio 2008, Visual Basic. is the IP currently assigned to me by Comcast (I watch carefully to see when it changes; also, I altered it for purposes of asking this question).


IIS memory increasing for each client request in asmx web service


A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes).  We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines.  The customer is using Windows 2008.

We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it.  The memory increases steadily - approximately 40K per client request.  If the test app is paused, the memory remains the same.  When it is closed, the memory drops.  Explicit calling of GC.Collect does not drop the memory.

We have run the memory profiler on the service and the leak is all native memory.  We have uninstalled/re-installed the Framework on one of the machines but no difference.  To our knowledge all of the security and IIS settings are not modified.  We have compared app pool, default web site and virtual directory properties to  machines that have no problem and they are identical.

Has anyone else experienced this?  Any suggestions?

asmx web service authentication


A web service I'm developing requires super-simple authentication - the customer has an API key, and this key needs to be presented on every request. I would have thought the best way to support this would be to include the key in the request header... but there is appearnly no simple way for the WDSL-created service objects to do anyting like that. I'm kind of surprised given you'd think that would be a basic feature... ? What's the best way of passing an API key into a web service without including it as a field in every method?

SSRS 2008R2 Forms Authentication - service won't start: rshost ERROR: Error in managed ServiceMain,


I implemented a forms authentication solution based on the MSDN sample. However, when I attempt to start the reporting services service either via Services or the RS Config tool, I get the following error in the reporting services logfile:


rshost!rshost!b04!04/12/2011-22:37:21:: e ERROR: Error in managed ServiceMain, error=0x8007000b

I have not been able to find any information around this error. Please help!!

Explained: Forms Authentication in ASP.NET

This module explains how forms authentication works in ASP.NET version 2.0. It explains how IIS and ASP.NET authentication work together, and it explains the role and operation of the FormsAuthenticationModule class.

Using Forms Authentication in ASP.NET - Part 1

Classic ASP developers often had to "roll their own" authentication scheme, however, in ASP.NET much of the grunt work has been taken out. This article outlines how things have changed and how FormsAuthentication can be used to secure a Web site with a minimal amount of code.

ASP.NET Forms Authentication - Part 1

Often, in legacy Web applications, users authenticate themselves via a Web form. This Web form submits the user's credentials to business logic that determines their authorization level. Upon successful authentication, the application then submits a ticket in the form of a cookie, albeit a hard cookie or session variable. This ticket contains anything from just a valid session identification access token to customized personalization values.

ASP.NET forms authentication with roles

.A timeout is specified in minutes. This is "time since last request" not the "time since login". If a login is indicated to be persistent (described later) this is ignored.
.A protection method is specified for the cookie.
Next I wanted to specify a folder to which access is restricted to people who have logged in. To do this I entered the following code in the web.config file (beneath

Forms Authentication in ASP.NET

In this tutorial you will learn about Forms Authentication in ASP.NET 2.0 - Forms Authentication class, Cookie Domain, Forms Cookies, The Login Control, Signin, Signout, Authenticate, Redirect, Login Status, Login Name and Login View Controls.

Problems with Forms Authentication in DD 4 site


Hello,  I am seeing a strange problem with Forms Authentication in my DD site.   A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.

in web.config I have

     <authentication mode="Forms">
            <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" />     

Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused.   Has anyone else experienced this or have any suggestions?  Thanks!

How to authenticate local user usin ldap or non domain authentication



I created one application, and I need to authenticate local user. This user is the user who is login to his/her Personal Computer.. Main thing his that he/she does not in any DOMAIN... I want NON-DOMAIN authentication.. any how.... please help...

Problem to obtain client IP on web service



I'm having problems to obtain the client IP on web service. Here's my scenario:

One server with Windows 2003, hosting the web service using .Net Framework 2.0, with IP and host name ServerTransaction.
Other server with Windows 2003, hosting a web application using .Net Framework 2.0, that consuming the web service on  ServerTransaction, with IP and host name ServerApplication.
Many other computers on the local network (IPs:,,, ...) acessing the web application on ServerApplication.

On the code of the web service I've tried to use HttpContext.Current.Request.UserHostAddress or HttpContext.Current.Request.ServerVariables("REMOTE_ADDR") or HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FORR"), but always I can only get the IP of ServerApplication (

Any idea or tip?

Thanks and sorry for my bad english.

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