Using WCF through proxy mode under. Net Core

Source: Internet
Author: User

WCF clients under. NET core are also open source, this time with. NET Core 2.0, and WCF for. NET Core 2.0.0, this article describes how to consume a WCF service via proxy under. NET Core.

We can now directly downgrade the WCF service in standard 2.0, but Microsoft WCF Web service Reference Provider is currently in beta, and to use this plugin, you need to install a Visual Studio plug-in, : Https://marketplace.visualstudio.com/items?itemName=WCFCORETEAM. Visualstudiowcfconnectedservice, the use of a lot of inconvenience, blog Park has a blog about this problem http://www.cnblogs.com/qulianqing/p/7197302.html.

A better way to use WCF is to use the proxy pattern encapsulation to invoke the WCF service and isolate the invocation of the WCF service into a separate project, which suggests a github example https://github.com/geffzhang/ Netcore-wcf-service-proxy.

The project includes:
    • Multiple WCF Services

      • A simple example of a WCF service that is connected through a message contract through a proxy class.
      • IOC uses Simpleinjector and its WCF integrated extensions
    • WCF Proxy implementations

      • A class library project that combines the actual service contract with the proxy implementation
      • Simple authentication implementation (not yet implemented)
    • Calling an ASP. NET core client for demonstrating use cases

Run the sample project in the following way:

    1. Download. NET Core 2.0 Sdk&runtime
    2. To open a solution using Visual Studio Update 3
    3. Building a solution
    4. Open the Netcorewebapp project to open the context menu for reference and recovery packages
    5. Running the solution (Ctrl + f5/f5), you see the following results in the browser:

Using WCF through proxy mode under. Net Core

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.