c# print windows service status in asp.net web - c#

Looking for solution to get windows service status print in asp.net web mvc.
tried using code into view code oh cshtml, but geeting error not found namespace for ServiceController

Related

How to integrate external google login/signup on Web forms asp.net

I saw the other post here that googleauth does not work on Web forms in ASP.NET, it only works on MVC project, if it does not work are there any options? Thanks! this is our first time creating external login

Web API Missing on deployment

So I have a C# MVC Web API and Web Application that is an all-in-one project. I've created something similar to this in the past but the Web Application and Web API were two different projects with two different URLs.
For example:
The Web Application would be hosted at mywebsite.com/webapp
The Web API would be hosted at mywebsite.com/webapi
Any time I wanted to call the Web API from the Web Application all I had to do is send an Ajax request using the URL mywebsite.com/webapi/api/getdata
However, with my current project it's all-in-one. So in testing I would simply call /api/getdata and it would work just fine in Visual Studio debug. But when I deploy this site for testing and actually host it all my API calls are met with HTTP 404 errors.
So how do I call the Web API when the Web API doesn't have it's own distinct URL?
In IIS I converted the folder to an application and then made sure to switch the calls from
mywebsite.com/api/getdata
to
mywebsite.com/myproject/api/getdata
and it's working now.
Credit to #mxmissile for pointing it out.

Passive web application calling a WCF service with ajax (.NET 4.0 , adfs 2.0)

How Passive adfs 2.0 authenitcation for Web application can consume WCF Restful Services?
I am using ASP.NET 4.0, C# to develop web application and WCF Rest Service.....
So could you please help me to understand how to secure Restful service using claim based authentication
Here is what I need: -
I have a Web App and WCF Rest service with webhttpbinding gets called from ajax jquery.
Now the user logs into the Web App which is relying party, he is redirected to the adfs login page.
Once logged in, he is redirected back to the Web app.
This web app invokes the wcf Service.
Passive authentication is working fine but issue is when calling WCF service.
In ajax call for wcf service get undefined error. (namespace attribute is not getting added example
var svc = project.services.AjaxService()
where project does not include services and namespace attribute is missing which is present when same code is getting called from form authentication.
Where project.services is namespace for service class AjaxService.
And also same service is getting called using Telerik controls WebServiceSettings.
Can anyone please help me in this. what configuration setting is required and anything else need to be added?
How can i achieve both using ajax and telerik.

How to deploy REST Web Service using IIS

I wrote a simple C# REST based Web Service by following
[https://www.youtube.com/watch?v=H9vBxAH4f5E]
When I copy folder to IIS and create application by Add Application, I am getting Error 500.
Is there something I am doing wrong ?
I have IIS v6 on Windows 7.
There is no main function, should I create console or web based application to render it ?
Any help or pointers will be great.

How does calling a web service from a .net app work?

I added a web service as reference to a project and gave it name "days". But I don't actually understand how to work with it. Can someone show me the way how to get data from it?
In posh I get data from a web service this way:
$ws= New-WebServiceProxy -uri $xmld.Root.WebService.Address -credential $cred
$xml = $ws.getdays()
$xml
Have a look at
Walkthrough: Calling XML Web
Services from Windows Forms
Creating a .NET Web Service
Walkthrough: Accessing an XML Web
Service Using Visual Basic or Visual
C#
Fortunately, you don’t need to write a client application to test a web service because .NET includes a test web page that ASP.NET uses automatically when you request the URL of an .asmx file in a browser. This page uses reflection to read and show information about the web services, such as the names of the methods it provides.
To try the test page, request the xyz.asmx file of the web service in your browser. (In Visual Studio, you simply need to set this as the start page for your application and then run it.)

Categories