All Projects → jolmari → netcore-wcf-service-proxy

jolmari / netcore-wcf-service-proxy

Licence: MIT License
Example of consuming multiple WCF services using a proxy implementation in a ASP.NET Core Web-application.

Programming Languages

C#
18002 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to netcore-wcf-service-proxy

grandnode2
Free, Open source, Fast, Headless, Multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, LiteDB, Vue.js.
Stars: ✭ 626 (+1390.48%)
Mutual labels:  netcore, asp-net-core
FluentAssertions.Web
FluentAssertions for HTTP APIs
Stars: ✭ 71 (+69.05%)
Mutual labels:  netcore, asp-net-core
csharp
📚 Recursos para aprender C#
Stars: ✭ 37 (-11.9%)
Mutual labels:  netcore, asp-net-core
Inyector
Library to Implement Automatic dependency injection by Configuration over Scaned Assemblies
Stars: ✭ 13 (-69.05%)
Mutual labels:  dependency-injection, asp-net-core
SignalR-Core-SqlTableDependency
Shows how the new SignalR Core works with hubs and sockets, also how it can integrate with SqlTableDependency API.
Stars: ✭ 36 (-14.29%)
Mutual labels:  netcore, asp-net-core
Uragano
Uragano, A simple, high performance RPC library. Support load balancing, circuit breaker, fallback, caching, intercepting.
Stars: ✭ 28 (-33.33%)
Mutual labels:  dependency-injection, asp-net-core
Awesome-Nuget-Packages
📦 A collection of awesome and top .NET packages sorted by most popular needs.
Stars: ✭ 87 (+107.14%)
Mutual labels:  netcore, asp-net-core
Scrutor
Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
Stars: ✭ 1,915 (+4459.52%)
Mutual labels:  dependency-injection, asp-net-core
DotNetDynamicInjector
💉 Dynamically reference external dlls without the need to add them to the project. Leave your project with low dependency and allowing specific dlls according to your business rule or database parameters.
Stars: ✭ 18 (-57.14%)
Mutual labels:  dependency-injection, netcore
JwtAuthDemo
ASP.NET Core + Angular JWT auth demo; integration tests; login, logout, refresh token, impersonation, authentication, authorization; run on Docker Compose.
Stars: ✭ 278 (+561.9%)
Mutual labels:  integration-testing, asp-net-core
statiq-starter-kontent-lumen
Lumen is a minimal, lightweight, and mobile-first starter for creating blogs using Statiq and Kontent by Kentico.
Stars: ✭ 22 (-47.62%)
Mutual labels:  netcore, asp-net-core
awesome-dotnet-async
A curated list of awesome articles and resources to learning and practicing about async, threading, and channels in .Net platform. 😉
Stars: ✭ 84 (+100%)
Mutual labels:  netcore, asp-net-core
Hexagonal-architecture-ASP.NET-Core
App generator API solution template which is built on Hexagnonal Architecture with all essential feature using .NET Core
Stars: ✭ 57 (+35.71%)
Mutual labels:  integration-testing, asp-net-core
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+11.9%)
Mutual labels:  netcore, asp-net-core
Fluentvalidation.blazor
Fluent Validation-powered Blazor component for validating standard <EditForm> 🌌 ✅
Stars: ✭ 140 (+233.33%)
Mutual labels:  dependency-injection, asp-net-core
Asmin
Asmin is .NET CORE project infrastructure, to get a quick start on the project.
Stars: ✭ 89 (+111.9%)
Mutual labels:  dependency-injection, asp-net-core
Singularity
A extremely fast ioc container for high performance applications
Stars: ✭ 63 (+50%)
Mutual labels:  dependency-injection, netcore
Autofac.extensions.dependencyinjection
Autofac implementation of the interfaces in Microsoft.Extensions.DependencyInjection.Abstractions, the .NET Core dependency injection abstraction.
Stars: ✭ 98 (+133.33%)
Mutual labels:  dependency-injection, netcore
SQLiteEncryptionUsingEFCore
SQLite Encryption using Entity Framework Core (EFCore)
Stars: ✭ 42 (+0%)
Mutual labels:  netcore, asp-net-core
Kodkod
https://github.com/alirizaadiyahsi/Nucleus Web API layered architecture startup template with ASP.NET Core 2.1, EF Core 2.1 and Vue Client
Stars: ✭ 45 (+7.14%)
Mutual labels:  netcore, asp-net-core

Why didn't I just use the existing connector?

This small project is my solution to a problem I came across when trying to access multiple WCF-services from a new ASP.NET Core project and could not get the official WCF-extension to properly create the interfaces.

Most of the examples found by simple googling came up with simple connector implementations. These did not showcase the actual problem and were lacking in situations where multiple connections are needed. The aim here is to create a generic, yet simple, way to handle such a situation.

What else is this solution good for?

The connected service reference is tied to one endpoint and to my knowledge the endpoint cannot be changed on the fly. Most web applications have multiple environments where they are run, so naturally the endpoints of WCF services will also change depending on the use case, ex. Production / Development implementations.

This Wcf proxy approach makes it possible to configure the endpoint in a configuration file and then configure the client itself to connect to this url, instead of using multiple separate connected service references.

Problem description

The first step in trying to enable WCF-services is to use the official Visual Studio extension found here:

https://blogs.msdn.microsoft.com/webdev/2016/06/26/wcf-connected-service-for-net-core-1-0-0-and-asp-net-core-1-0-0-is-now-available/

The WCF Connected service for .NET Core 3.1 should fit to most use cases, but the library is not compatible with more complex (or incorrectly configured) services. You might face an error similar to the following, in such a case, the best option is to connect programmatically to the service via a proxy class library. This repository shows one way to implement this approach.

Scaffolding Code …
Error:Error: No endpoints compatible with .Net Core apps were found.
An error occurred in the tool.

Failed to generate service reference. 

Solution

  1. Services are implemented in WcfServices
  2. WcfProxy project uses service references to create service contracts
  3. Wrapper classes in WcfProxy-project mask the actual services implementations and instad call them through the Proxy-class.
  4. Wrapper maps the Dtos to separate model classes
  5. ASP.NET Core injects the wrappers where they are used

The Wcf services are completely isolated from the ASP.NET implementation and no references are needed to WcfServices-project.

Running the solution

git clone https://github.com/jolmari/netcore-wcf-service-proxy.git
  1. Download the .NET Core 3.1 SDK & Runtime
  2. Open the solution Visual Studio 2019
  3. Build solution
  4. Open the NetCoreWebApp project, open context menu on references and restore packages
  5. Run the solution (Ctrl+F5/F5)

Alt text

This project includes:

  • Multiple WCF services

    • Simple examples of WCF services that are connected to by the proxy-class via message contracts.
    • IoC using built-in ASP.NET Core Dependency Injection.
  • WCF-proxy implementation

    • A class library project that wraps the actual service contracts with proxy implementations
  • ASP.NET Core client that calls is used to demonstrate the use cases

Troubleshooting

  1. The services don't start:
  • Solution Explorer -> Solution -> Properties -> Startup Project. Start WcfServices & NetCoreWebApp.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].