asp.net core 2.0 wcf configure binding - wcf-binding

I use a asp.net core 2.0 web api with a connected wcf service.
On normal asp.net i can configure the basicHttpBinding in the web.config. But i can't find any solution to configurate the basicHttpBinding in asp.net core.
I have to set the transferMode="Streamed" and maxReceivedMessageSize="128108864".
Edit: it is a asp.net core 2.0 web api but with a full .net target framework

I have just encountered similar problems. So it seems that web.config is no longer available, because it's only used in IIS, and since Asp.net core 2 doesn't need IIS, web.config is irrelevant. I did try to add it though, but it wouldn't work.
Best thing is to do it programmatically.
BasicHttpBinding vidiBinding = new BasicHttpBinding();
vidiBinding.MaxReceivedMessageSize = 2000000;
EndpointAddress myEndPPtAdd = new EndpointAddress("http://localhost:9200/SilverlightVidiCloudService");
VidiExternalCloudServiceClient myClient = new VidiExternalCloudServiceClient(vidiBinding, myEndPPtAdd);
await myClient.OpenAsync();

Related

DependencyResolver in ASP.NET Core. Also how to access HTTPConfiguration in ASP.NET Core?

We are migrating our project from ASP.NET Web API to ASP.NET Core 6.0 Web API as part of that we having following below lines of code.
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
The config is a HTTPConfiguration but while migrating to .NET 6.0 I was not able to access HTTpConfiguration from WebApplicationBuilder or WebApplication.
Please let me know how to access HttpConfiguration in .NET 6.0 and assign the DependencyResolver.
In .NET Core you don't explicitly set the dependency resolver and there's no HttpConfiguration. It's a whole different application and hosting model. I'd recommend following some of the tutorials about ASP.NET Core - it's similar, but different enough that the answer to this question would basically be to replicate all the existing migration docs and tutorials already on the Microsoft doc site.

Is it possible to create SOAP service with .net core 5.0?

I have an WCF application with SOAP service that need to be migrated to .net core to be able to run on unix, and not only on IIS as it does now. However the only example I found was to rewrite the application on .net core 2.2 whis is not supported any longer.
Any advice of how to proceed?
Is it possible to create SOAP service with .net core 5.0?
You can create an ASP.NET Web Application(.NET Framework) to create a SOAP Webservice, then create an asp.net core 5.0 application and call the SOAP service.
Besides, you can also try to use SoapCore package in the asp.net core 5.0 application, then create the SOAP service. You can refer the SoapCore Getting Started or search "create soap web service in dotnet core" using Google, there have multiple tutorials about using SoapCore, you can check them.

WCF Rest Service Reference in ASP.net core 3.1 API

I've created a WCF Restful service(Framework 4.7.2) and hosted the service in IIS sever. I would like to add the service on a ASP.net core 3.1 Api. It does fails while adding it via connected service. The wcf service has endpoint with webhttpbinding.error
Any help would be appreciated..
Core does not support webhttpbinding, wcf only supports BasicHttpBinding, CustomBinding, NetHttpBinding, NetTcpBinding:
So there are two current solutions:
Modify the binding of the server, do not use webhttpbinding.
The client continues to use the .net framework.
Feel free to let me know if the problem persists.

How to configure MessagePack on SignalR with Owin and WebApi 2?

We have a SignalR service that runs as a self-hosted OWIN app with Web API 2. It is configured like
resolver.Register(typeof(JsonSerializer), () => JsonSerializer.Create(serializerSettings));
app.MapSignalR(new HubConfiguration { EnableDetailedErrors = true, Resolver = resolver});
We want to replace our JsonSerializer with MessagePack. The obvious examples all configure it from a AspNet.Core web application context. I can't seem to find any examples with Owin self hosting.
EDIT: It looks like MessagePack is a new ASP.NET Core feature. We are running the older ASP.NET version and so I guess the real question is how to do binary formatting over ASP.NET SignalR.
It's not possible. I am migrating my solution to the AspNetCore version of SignalR.

Consume a WF hosted in IIS as a WCF service using ASP.NET 1.1 Client

As the title says, I would like to consume a WF workflow using a ASP.NET 1.1 client.
The workflow is hosted on IIS as a .svc service.
I have a .NET 3.5 winforms test client that uses wsHttpContextBinding.
Because I need to put a WorkflowID in Context to have my workflow rehydrated and continued, I use this piece of code:
var Svc = new MyClient.MyService();
var Ctx = new Dictionary<string, string>();
Ctx.Add("instanceId", workflowID.ToString());
var CtxMgr = Svc.InnerChannel.GetProperty<IContextManager>();
CtxMgr.SetContext(Ctx);
Svc.MyOperation();
It's working fine this way.
Unfortunately, my ASP.NET 1.1 legacy appliction need to consume this workflow. I have setup an additional endpoint that uses basicHttpContextBinding.
I have read the context has to be passed to a cookie, and I'm stuck here as I have no clue about how to do this in the caller code.
MyClient.MyService Svc= new MyClient.MyService();
// How to set the workflowID ?
Svc.MyOperation();
How can I set the context with a workflowID in the cookie ?
Apparently, there is no miracle nor solution. The workflowID has to be handled to the client side, which concerns me because the client is not aware about the server plumbing.