Objective:
We have a Windows Service/generic EXE that also hosts a WCF service (.Net 3.5). I'd like to be able to take a third party ASP.NET component in a DLL, and host it through that WCF Service.
Is this possible to do, in any way?
It seems like if you want to host a ASP.NET app, it must be through IIS, but we don't use IIS.
Is there any way that we could load the ASP.NET app into memory, make the app available through an endpoint, and receive requests back from the app?
Specifically, we'd like to take the "Microsoft.ReportViewer.WebForms.dll", expose the web form in a web page, and accept any requests back from the web form.
http://msdn.microsoft.com/en-us/library/ms251723.aspx
Looking for anything to get me started. Thx.
From owin.org
"OWIN defines a standard interface between .NET web servers and web applications. The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools."
Essentially Owin implementations, like Katana (OWIN implementations for Microsoft servers and frameworks.), help you self host web apps, even in a Windows NT Service.
According to this post, hosting a WebForms app outside IIS/ASP.NET is not possible.
WebForms are tightly coupled to ASP.NET/IIS and cannot run directly on
OWIN/Katana (e.g. outside of ASP.NET/IIS). However, you should be able
to use Katana's middleware (Security, CORS, etc.) in a WebForms
application.
http://katanaproject.codeplex.com/discussions/571291
Related
So I'm creating a new .Net Framework 4.8 Web API in Visual Studio 2019 and I'm wanting to know how to create the API as a windows service? I can't seem to find any examples or online resources to do so. I can run the API locally in VS and it opens Chrome and shows the responses under the local IIS Server it spins up. How do I take this same project and compile it as a windows service while still using HTTPS?
Web API is fully capable of being self hosted on top of OWIN, and does not require IIS to run.
Web API self hosted is basically just a console app. So the techniques for turning a Web API console app into a Windows Service are the same as for any other .NET console app. You can use a service manager such as NSSM, or create a Windows service project directly (by inheriting from the appropriate classes, pretty messy) or use a library like TopShelf.
Note that it's generally not a good idea to directly expose this self hosted app directly to the public. IIS provides a lot of security benefits out of the box designed to protect against malicious requests. If you're planning to publicly expose it, make sure you stick a proxy in front of it that will fulfill those security needs.
We have a CRM/ERP web application (ASP.Net Forms) running on top of SharePoint (WSS and 201x).
On the other hand we have add-ins for Office (WPF) closely integrated to the web application via WCF services.
Both rely heavily on a WCF services project, in three ways:
WCF services called from code behind
AJAX-enabled client web services using webhttpbinding / enablewebscript
WCF services called from the add-ins.
However, there is a security concern.
In our current set-up, the WCF services need to be set to Anonymous authentication.
Otherwise our web application and add-ins won't work using the current configuration.
Our goal: to disable the anonymous access to the WCF services somehow, without breaking either the web application or add-ins.
This proved much less straight-forward than expected.
This is our typical set-up:
Extended SharePoint site (WSS / 201x). Alternate Access Mapping
configuration:
Default: Active Directory, NTLM.
Intranet: Membership Provider, Anonymous access.
ASP.Net web application runs within the main SharePoint web application (no sub web application in IIS).
WCF services project is configured in IIS as a 'sub' web application beneath the SharePoint web application.
This is what we came up with so far:
Added in the WCF services web.config
Changed Windows Authentication -> Advanced Settings to the following:
Extended Protection: Accept
[X] Enable Kernel-mode authentication
Changed client binding configuration of add-ins and web application to Security Mode TransportCredentialOnly with clientCredentialType Ntlm.
Above solution works in our SharePoint 2007 test environment in all three aforementioned places.
However in SharePoint 201x we can't get the WCF calls from within the web application to work.
At least not using the same client bindings as the add-ins (while the WCF calls from the add-ins also work in SharePoint 2013).
The error message we’re getting is: No credentials are available in the security package.
Another one we encountered is: Provider type not defined. (Exception from HRESULT: 0x80090017)
Question: How can we use WCF services non-anonymously from within a SharePoint web application and from WPF?
Any idea's on how to configure and call these in this scenario? (one way or another)
Any thoughts on this are greatly appreciated!
can you please tell me what is the difference between webservice and webapplication.
A web service:
Typically returns XML or JSON or something like that, something that is easily decoded by a program
The results you get from a web service is typically not just shown to a person in its raw form (ie. since it isn't HTML, the results have to be reformatted, like placed into a form)
The intended usage of a web service is that it is something an application can talk to
A web application
Typically returns HTML or image data or similar
The results you get from a web application is usually shown to a person, through a web browser
As for similarities:
Both typically use HTTP(S) as the transport
Both typically use HTTP authentication/authorization to secure data
Both are typically hosted by a web server
So the main difference is who usually talks to them. A web service usually by another application, a web application usually by a web browser. Other than that they're pretty similar.
Here is the Web Application and here is Web Service
Web application: any application which resides on a server, and mainly used by human using web browser. All user interactivity is done through web pages.
Web service: server-based application (as above) which may be accessed over the web via HTTP, but is meant primarily for interaction with other programs. Generally it is WEB API for other applications.
In a nutshell, a Webservice uses special HTTP transport protocols to communicate to other servers. Webservices are meant to be used by other applications.
In the ASP.Net world, a web application is a type of Visual Studio project that allows building ASP.Net websites in a particular configuration. E.g. A Webservice can be built using a Web Application type project. Or a Web Application can also refer to a website that is meant to be used directly by an end-user ( unlike web services ).
Here are a few links and related SO questions...
What is the difference between an asp.net web method and a wcf service?
ASP.NET Web Site or ASP.NET Web Application?
Introduction to Web Services and ASP.NET
check this
http://en.wikipedia.org/wiki/Web_service
http://www.w3schools.com/webservices/ws_intro.asp
I have a .net application running on server. Now I want to comunicate between my ASp.NET website and the server application.
Currently I use database, server writes info to the db and site uses it etc. However adding new fields to echange and exchanging complex object is a pain.
Is remoting the way out? If yes, what are the common things to keep in mind while doing this.
both server and asp.net site is on the same server
both is under my control
is there any other better way than using remoting?
It is .NET 2.0
The purists will say that remoting is an old, dead technology, and the way to do it now is to use WCF.
If you're attempting to have some SOA thing, the best thing is to a web service for your server application and access it from your ASP.net website application. It's the best way to do.
However I don't really understand what the purpose of the "server" is? Couldn't your ASP.net website - as you say - be your front-end of the server application?? Your "server" would then simply be the business and data layer and there would be no need to use remoting or WCF.
I would say webservices if want to stay .net 2.0, otherwise it think you should take a look at WCF.
If you need direct interaction between assemblies (ASP.NET and some server application or service) you should use Application Domains and cross-domain calls (some good example here) or using WCF, which is better. Also you can use web services if your server application can be accessed via web without major resulting drawbacks (security issues, server deployment change, etc.).
Actually, u can deploy a WebService on that server. WebService is base on SOAP, it can exchange data object with your website.
If you can update to .Net Framwwork 3.5, you can try to use WCF instead.
Is it possible to create a Windows Service (background apps accessible in services.msc) application and host an ASP.NET WebService or a Silverlight compatible WebService within it?
I want to create a WebService that performs COM interop calls to something and decided that a Windows Service that interfaces with COM directly as well as hosting the WebService would be the most flexible way to go. I can then create a ASP.NET website and Silverlight application to interact with the WebService.
The other way is to have the ASP.NET perform the COM interop calls on the server side but how safe is this and does .NET even allow that?
You cannot host an ASMX web service in a Windows Service. You can, and should, do it with WCF, which replaces ASMX.
On the other hand, there's no reason you can't use COM interop in an ASP.NET application, as easily as you can with any other .NET application. The only thing to be aware of is multithreading; since it will be called from a service, your COM object will be getting called on multiple threads, which it may not expect.