.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

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

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :Windows Application
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"

View Complete Post

More Related Resource Links

Unable to call WCF Service (svc) from .NET Windows Service



 I have an odd problem. I created a windows service and in it I created a reference to my wcf service which is hosted in IIS. I generated the proxyclient for async operations.

When I tried calling it in my development machine it didnt throw any error but it also didnt invoke the wcf service. After a lot of permutations I changed the user account of the windows service to "Network Service" instead of "Local System" and it started working.


Now i have deployed the same to Windows 2003 server. I have again landed up with the same issue. I did change it to Network account but no use. I am not too sure whats the problem as no errors are being thrown nor is it showing any errors in debug mode.

Any thoughts on this pls?

Thanks & Regards



Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Trying to call an asmx web service from a test project

I am trying to create a proxy for an asmx web service. The only thing I find in Visual Studio 2008 is a service reference. How do I call an asmx web service with a service reference? Certified Geek. Professional Data dude.

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

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

Suspend / Resume Instances within Workflow Service Host (in Windows Service)

We are hosting WF 4 worklfow instances within a Windows Service that uses the Workflow Service host container.   On the Windows Service OnStart we start the workflow service host (w/ multiple WCF endpoints such as start workflow instance, cancel workflow instance, poll workflow instance status, etc.) and these endpoints create or work on one or more long running workflow instances.     My question is, if a user attempts to stop the Windows Service while workflow instance(s) are running, what is the best way to manage this scenario.   Our inclination is to persist these workflows (using sql persistence) and then on the next start of the Windows Service, resume these workflow instances and allow them to continue to completion.    In OnStart, we have a handle to the Workflow Service host.    How can we iterate through all the active workflow instances in OnStop and then in OnStart, resume these after the workflow service host is opened and running?   Are there are any methods of managing this scenario?    Thanks

how to store credentials with windows authentication in reporting service for subscription

when I try to set up a subscription, I get this error message: "Subscriptions cannot be created because the credentials used to run the report are not stored or if a linked report, the link is no longer valid" I use a datasource which use windows credentials to access a database which contains stored procedure with OpenRowset query to access cube data in analysis service on the same server.  I have to use windows credentials to access cube data in analysis service.  How can I store the credentails with windows credentials? I appreciate your help!

Windows Workflow Persistence Service using Oracle Database



We are using windows state machine workflow. We need to use Oracle for persisteing and tracking workflow instances. Can anyone provide custom services for Oracle?

We have even tried WFTools but not able to connect to Oracle database. Please provide the same code if anyone has tried.





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




We are getting the following error, when we call a WCF service from IE. The service is developed in MS.NET 3.5 and hosted in IIS 6.0, Windows Server 2003 SP2


Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service.


NOTE: The same is working GOOD in IIS 6.0, Windows XP SP2


IIS Setting


"Integrated Windows Authentication" is enabled in the "Directory Security"






<binding name

Getting error when referancing third pary .asmx in windows service as Service Referance



   I referenced a third party Web service (.asmx) WSDL file as service referance in Windows Service. When I execute from WCFTestClient.exe, I am getting response back. I am not able to create an instance of proxy in windows service. I could create in Web app. I am getting the following error.


"Could not find default endpoint element that references contract 'EDIService.notifyGasNomsEvent_PortType' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

                <binding name="meterdatamgmt_public_pub_wsds_notifyGasNomsEvent_Binder"
                    closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"

Create an exchange interface to call a Windows Service with WCF


I'm develpong an application that consists on a Client that communicates with a Windows Service via WCF.
I have three projects defined: MyClient, MyService, MyExchangeClasses

The first two are easy to understand, client and server. The MyExchangeClasses project contains the interface for MyService remote function calls and contains the implementation of those classes that are passed via parameter o are returned by the remote functions that implement the interface I've already mentioned.

For example I have one remote funciton defined in the interface like this:

public interface IService1
   IEnumerable<MyObject> GetAllMyObjects();

And MyObject is defined like this:

public class MyObject    
    public String Name { get; set; }

So in order to make it work MyExchangeClasses needs to be referenced in both MyClient and MyService classes.

How to debug Windows Workflow when it is hosted by WCF Service ?



I have build a test solution in two parts :

1) WCF service which hosts a Windows Workflow (statemachine).

2) Console application which consumes the WCF Service.

It works well, but if I do a bad process, it crashes which is normal. Exemple : the client calls an event which is impossible to execute given the current state according to the workflow design. In this case, the client receives a WCF exception. This exception is masked, which is normal (an option has to be set in WCF side to enable exception transmission).

The problem is that, althought I launched the console application with the debugger, with the WCF service project, the debugger doesn't break on Workflow errors in WCF error side. (However, I saw that non-Workflow errors in WCF side are still stopped by the debugger)

How could I force the VS debugger to break on Workflow WCF errors ?


(Workflow 3.5)

Windows Service crashing on call to unmanaged code, even though console app version works


I have a C# program that at some point calls 2 functions from an unmanaged dll using p/invoke.  Everything works fine when I'm running in a console app.  When I compile the same program as a windows service and run it, it crashes.  The console app and service should be identical as far as my code is concerned... all either program does is create an object from another assembly of mine and run a Start() method on it.

I have used VS2010 to debug the managed and unmanaged code, and when I step through the Console app everything looks great.  When I attach the debugger to the service, i can step through the first function in the unmanaged code, control returns to the managed code, and then later when it comes to the point where it calls the second unmanaged function, the process terminates immediately before the debugger steps into the first line of unmanaged code.  There are no exceptions that I can see, and the only thing written to the event log is the generic "service terminated unexpectedly" message.  Running "sc query" on the command line lets me know the win32_exit_code is 1067.

Im running everything in .net 4, on winxp 32bit.  The serivce is running as Local System ideally, but the same behavior exists when I run it under my user account. 

How to enable windows authentication for a RESTFul web service which is not hosted in IIS


I have created a WCF RESTFul webservice by following http://msdn.microsoft.com/en-us/library/dd203052.aspx. I am hosting my RESTful webservice in a window service (and not IIS) using the WebServiceHost class. 

Now I am struggling to get user's windows credentials in my web service methods. I looked at various code samples in forums for this. Almost all of them are hosting the service in IIS plus configuring  the service's settings using <system.serviceModel> tag.

I don't want to host my service in IIS plus as of now I haven't overridden any EndPoints, Behaviours etc in .config file.

I tried with below code in my window service's onstart method

WebServiceHost host = new WebServiceHost(typeof(MyService), new Uri(_serviceUrl));

ServiceAuthorizationBehavior myServiceBehavior = host.Description.Behaviors.Find<ServiceAuthorizationBehavior>();
myServiceBehavior.PrincipalPermissionMode = PrincipalPermissionMode.UseWindowsGroups;


After putting above code I queried ServiceSecurityContext.Current and System.Threading.Thread.CurrentPrincipal  my RESTFul's method but they are showing no sign of return

Deploying an .asmx Web Service on a Windows Server 2003 machine

Hi, I have created a WEb Service using Visual Studio 2008 on an XP PC. I have sucessfully deployed the web service and tested it correctly on my local machince. It is located at http://localhost/MAC/Service.asmx.

Now, what I want to do is deploy this Web Service on a server. The server is running Windows Server 2003 Web Edition. I thought it was only a matter of copying the "UMACS" folder on my XP PC, which includes the Service.asmx, web.cong and service.cs files etc, and then copy this to the server and try to deploy it through IIS.

I have tried this but everytime I try to access http://localhost/MAC/Service.asmx like before, I get "Error 404: Web site cannot be found". I have done a lot of searching on this. I have enabled IIS apping use the command "c:WINDOWS\Microsoft.NET\Framework\1.1.4322\aspnet_regiis.exe -i" but still this doesn't work.

Is there something else I need to do to deploy this web service?

In the IIS on the server, there is a "Web Service Extensions" section. Do I have to do something in here first to make it work?

MSMQ Recieve Activty fails in workflow hosted in Windows Service



I am trying to implement a windows service hosted workflow service that polls from a message queue. The message queue is is populated by a separate windows service.

I followed the post below for my hosted workflow as it looked to be close to what I was trying to do.


Following the steps in the post I was able to get my service to work when the message body was a simple string and using the WCFTestClient.

I then changed the code to use a a custom .NET object as the Recieve parameter instead of the string. The class library in which the object is defined was added as a reference. The service that populates my queue uses the custom .NET object as the message body.

In this scenario, the service would run but only process a message from the queue if it was in the queue before the service started. Any new messages added are ignored and if I add the message after I start the queue it also does not get picked up.

My xamlx is below, followed by my app.config:



Web service call fails on Windows 7


I have a Windows application written in C# using .NET 2.0 and Visual Studio 2005. I develop on a Windows XP machine. The application makes web service calls over SSL. To support SSL, I have to install WSE 3.0 on the development machine.

When I run my app on an XP machine it works perfectly and makes web service calls to an SSL enabled web service after I set the following registry entry to a non-zero value:

DWORD Value = zero Value = nonzero
UseScsvForTls  Client sends Renego Info extension for TLS  protocol  Client sends SCSV for TLS  protocol



The problem occurs when I run the app on a Windows 7 machine. The web service call fails with the following error:


The underlying connection was closed: An unexpected error occurred on a send.-   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)

   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)

   at Mic

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