Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to consume WCF WSHttpBinding in .net core

I'am trying to move my project from .net to .net core. I was initially using WCF WSHttpBinding service in .net but I'am unable to consume the same in .net core. I tried using BasicHttpBinding to connect with WsHttpBinding on the client side, but it throws an error saying the Bindings should match on both client and server side.

Suggest how to implement WSHttpBinding on .Net Core without modifying WSHttpBindings on the client side.?

like image 561
Niraj Bhattad Avatar asked Sep 05 '18 10:09

Niraj Bhattad


People also ask

Does .NET core support WSHttpBinding?

Net Core does not support WSHttpBinding.

Does .NET core support WCF?

NET Core and . NET 5 support calling WCF services, but won't offer server-side support for hosting WCF. There are two recommended paths for modernizing WCF apps: gRPC is built on modern technologies and has emerged as the most popular choice across the developer community for RPC apps.

What is WSHttpBinding in WCF?

Defines a secure, reliable, interoperable HTTP binding suitable for non-duplex service contracts, which implements WS-Reliable Messaging and WS-Security.

Does .NET core support SOAP?

NET Core platform. It provides a compatible implementation of SOAP, NetTCP, and WSDL. Usage in code is similar to WCF, but updated to use ASP.NET Core as the service host, and to work with .


1 Answers

I was able to make it work using a custom binding. There are also https, text, and binary binding elements that can be configured.

var binding = new CustomBinding
{
    Elements = { new HttpTransportBindingElement //or HttpsTransportBindingElement for https:
    {
        MaxBufferSize = int.MaxValue,
        MaxReceivedMessageSize = int.MaxValue
    }}
};
like image 155
Nicholas J. Markkula Avatar answered Sep 30 '22 23:09

Nicholas J. Markkula