Implement Self-Host project practice based on ASP. NET WebAPI OWIN, webapiself-host

Source: Internet
Author: User

Implement Self-Host project practice based on ASP. NET WebAPI OWIN, webapiself-host
Reference

Host ASP. NET Web APIs do not necessarily require IIS support. We can use any type of applications (console, Windows Forms Application, WPF application, or even Windows Service) as the Host using Self Host.

I. Summary

This article also shares with you the real business scenarios encountered by Alibaba Cloud in actual work. Please follow the Alibaba Cloud's perspective on how to adopt Microsoft's ASP. net owin Technology carries the WebAPI service. If you are interested in the content of this tutorial, please allow Alibaba Cloud to learn with you!

We don't need to talk much about it. We just need to get the dry goods directly. We don't make the dry goods, but we are just the porters of the dry goods.


All the dry goods you want are here. 4. Demand Analysis

4.1,Last Review

In the previous issue, we shared the implementation of client-to-server communication projects based on open-source SuperSocket. In practice, the WEB page was submitted and printed to the WEB server, the WEB server pushes the received printed data to the specified client through the Socket communication server.

Can we simplify the above call procedure?

Directly let the Client Print the data to the local client, without the need to use the Socket communication server for transit.

4.2 schematic

 


Schematic diagram

4.3,The problems we want to solve today can be summarized as follows:

How does one allow the WEB Client to directly access the local Desktop client through HTTP, just like accessing Web applications on Remote IIS?

4.4,Implement the Self-Host solution for WEB Applications

Implement simple Http Services (. NET 2.0 +) through HttpListener)

Self-host SelfHosting Based on WCF Stack

Use ASP. NET HttpSelfHost to host WebAPI services (. NET 4.0 +)

Use ASP. net owin to host WebAPI services (. NET4.5 recommended by Microsoft)

And so on ......

5. Covered knowledge points

How does ASP. NET WebAPI HttpSelfHost/OWIN host the WebApi service as a desktop application;

How does ASP. NET WebAPI HttpSelfHost/OWIN enable the server to support cross-CROS access;

Explorer 10.0 and earlier browsers use XDomainRequest to implement CORS access;

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.