.Net Core calling all "old" WCFs possible? - wcf

I thought I would try out .Net Core (v1.1.2) and one of the things I wondered about was if it was possible to call a WCF service written in .Net Framework 4.5.2. I am using Visual Studio 2017 and installed the Microsoft WCF Web Service Reference Provider (version 0.5.10428.1201). When I ran it, it found the service, but I got this error message when trying to generate the code:
Scaffolding Code ...
Error:Warning: Unsupported message encoding value: 'Mtom'. It must be 'Text'.
Warning: Unsupported message encoding element type: 'System.ServiceModel.Channels.MtomMessageEncodingBindingElement'. It must be one of the following types: 'System.ServiceModel.Channels.BinaryMessageEncodingBindingElement', 'System.ServiceModel.Channels.TextMessageEncodingBindingElement.'
Warning: Endpoint 'WSHttpBinding_IDocumentSignService' at address 'http://xxxxxxxxxxxxx.svc' contains one or more bindings not compatible with .Net Core apps, skipping...
Error: No endpoints compatible with .Net Core apps were found.
Failed to generate service reference.
(I edited the url to http://xxxxxxxxxxxx.svc)
Does this mean that .Net Core apps can't call all WCF services yet? Will it only support a certain subset? So that if I am stuck in a world of WCF services I will have to stay away from .Net Core? Or is it simply a problem with the tooling?
I realize this has probably been asked before, but I could find no clear answer.

As explained by panagiotis's comment, you're consuming a SOAP service with MTOM encoding (what is not supported by .net Core)
Nevertheless, consuming WCF services works fine in .Net core, as long as it is not relaying on WS* bindings.
extra info here
I was also having trouble by consuming MTOM encoded SOAP services.
I explain how I fixed it here

Related

Is it possible to use DevForce with new .NET5, NET6?

As I know DevForce use WCF for the communications between client and server.
But in newer version of .NET (Core 3.1, .NET5, .NET6 etc) WCF services not supported.
Is it possible to configure DevForce to use endpoints based on GRPC\WebApi instead of WCF?
As a trend for the future, you can try using gRPC, CoreWCF, and ASP.NET Core MVC instead of WCF. With the.NET upgrade, some technologies have been fully ported, but not WCF, and the replacement for WCF is the technology mentioned above.
The following article lists some of their characteristics for your reference, I hope it can help you.

WCF & DataContract consumed by .net 2 client

I have developed a WCF service (framework 4.0) which should communicate with a client through BasicHttpBinding.
I have kept my (data)contracts in a separate assembly cause I want them to be reused by multiple clients.
Everything works as expected if I reference my WCF Service as a service (Service References) in a .net 4 client and set "Reuse types in referenced assemblies".
The problem is I have to consume the same WCF service with a .net 2 client.
In this situation the generated proxy is different from my shared assembly datacontract and I don't seem to be able to reuse it or cast it to the generated proxy.
Is there a way to solve this issue?
Thanks for your help.
Well, .NET 2.0 has no WCF API at all because it wasn't added until 3.0. So forget sharing the library because there's nothing to really share it with. The .NET 2.0 application will have to use the older WSE (Web Service Extensions) API. Documentation on WSE is available here on MSDN and you can download the last version of the WSE API that was made, 3.0 SP3, here.
You should have no problem getting WSE to talk to WCF via a basicHttpBinding. Things would only get complicated if you started using WS-* stuff and, even then, WSE supports a lot of that. It's just hard to find help on it since it's a deprecated API.

How to Use the WCF Service developed in .Net 4.0 in the Application developed in 2.0 or lower version?

I came across with this situation. I have one already developed Application in 2.0, Now in this application i want to use one WCF Service that is developed in 4.0. How can i do this?
I tried the following
1. Regular Method Add the Service Reference and then use that. It didn't work for me.
2. I googled it and i got one more method, using svcutil.exe, but i dont have svcutil.exe with 2.0.
Waiting for the response.
Thanks in advance.
Windows Communication Foundation (WCF) was first introduced to the .NET Framework as part of .NET 3.0. It's not available with .NET 2.0.
If the WCF service exposes a SOAP endpoint then you may be able to use it through the Web Service Extensions (WSE) that were published for old versions of Visual Studio. See here: http://www.microsoft.com/download/en/details.aspx?id=10854 for details.
If you want to use a service written in .Net 4 with a .Net 2.0 project, you should be able to use basic http binding. That should allow it to interop with a client that knows nothing about WCF. It's similar to using an old school .asmx web service.

consuming WCF service in .net 2.0 windows application

I'm new in WCF service and I need to consume the WCF service from my client for my current .net 2.0 windows app. I successfully added the WCF service as web reference in my .net 2.0 application but when using the web method of the service it took long time to execute the method and in the end my application is not responding. Base on the request in fiddler, the request has been timed out. My client provides me a user name and password but I don't know where to use it. Base on the wcf web service wsdl of my client, it uses WSHttpBinding.
I also created a sample .net 4.0 windows application and added the service as reference but still cannot use the web method. I check also the request in fiddler and gives me a response error "The request for security token could not be satisfied because authentication failed.".
Please help. I need to consume the WCF service using my existing .net 2.0 application.
Thank you very much in advance!
If you want to consume your WCF service from .NET 2.0 via adding web reference you must use BasicHttpBinding - that is only backward compatible build-in binding (except custom defined binding) with ASMX based client.
Your exception in case of .NET 4.0 test complains about security token - WsHttpBinding uses Windows security by default. It is hard to diagnose the problem further because you didn't provide enough information.

WCF Integration with Legacy Remoting Client

I am facing a problem.
Please explain if this is possible or not.
1) I created a Service Library (.Net 3.5)
2) I created a Windows Service (.Net 3.5), added ServiceHost and implemented my ServiceLibrary to work as a TCP Endpoint.
3) Next I created a Console Client (.Net 3.5) and tried to get data from my TCP Endpoint…(svcutil….proxy.cs generation). Worked absolutely fine.
4) I have a Windows Client(.Net 1.1). How do I configure it to use this new Service? I can't add Proxy.cs as it says that servicemodel cannot be found…
You will need to use a basicHttpBinding, which is backward compatible and can be consumed by a .net 1.1 client. You should be able to find plenty of useful examples on the web: Consuming WCF with .Net 1.1 Basic Binding. For example, this Link describes that binding and usage of Soap 1.1 to make it compatible with .Net 1.1.
For more details on different scenarios and the range of wcf configuration possibilities, try exploring this CodePlex Link, specifically the Application Scenarios section that provides details of different setups. I believe that you will require a basicHttpBinding rather than a netTcpBinding in order to work with legacy protocols. The netTCPBinding would assume that you have .NET 3.0 at both ends. See this MSDN Bindings Link.