Posts

Showing posts with the label WCF

Donate

Login failed for user 'Domain\MachineName$' When Connecting To SQL Server From WCF Or Windows Service

Image
Hello, In the event that you have a Windows Service that has some piece of sql or EF code that will connect to a SQL Server database and it will generate an error specified by the title of this post, the solution that worked was to add that machine to the Security node of the SQL Server instance. To elaborate the solution, first is to create a new Login object inside the Security node using the script below or thru the SSMS IDE. Use Master GO CREATE LOGIN [PH\GGSP006450$] FROM WINDOWS Once the login object has been created, go the User Mapping tab and select the appropriate database(s) that the machine will connect to and check the db_owner, db_datareader and db_datawriter roles for that that database. After that, your service can now connect to the SQL Server database. Cheers!

How To Debug Or Step Through A WCF Service In ASP.NET MVC Application

Hello, In order to step through the WCF project in debugging mode through and ASP.NET MVC, follow these simple steps. WCF Project 1. Right click on the Solution of the WCF Service Project 2. Choose Properties 3. On Startup Project -> Select Multiple startup projects 4. On the Action dropdown of the WCF Service project, choose "Start". ASP.NET MVC Project 1. Run the WCF Service Project using the default web browser 2. Add a WCF connection using Connected Services (Make sure to type the correct url of the service). See web.config value below. 3. In web.config, add an endpoint element for the WCF service. <endpoint address= "http://localhost:63070/Service.svc" binding= "basicHttpBinding" bindingConfiguration= "BasicHttpBinding_Service1" contract= "DataLocalHostService.DataService" name= "BasicHttpBinding_Service1" /> 4. In your controller, you may call the service based from...

Donate