Using WCF Client without installing .NET Framework 3.5? - c#

I have a WCF Service built with .NET Framework 3.5. I have a task to develop a WCF Client which only uses .NET Framework 2.0. The WCF Client will receive messages which is broadcasted from WCF Service. Can I do this?
The WCF Client runs well on a computer has .NET Framework 3.5. However on a computer which only has .NET Framework 2.0, and including WCF's DLLs in application's folder, WCF Client only send message to service ok but can't receive message from WCF Service.
WCF Client ---> WCF Service : OK
WCF Client <--- WCF Service : Not OK
Please help me. Thanks.

If your service exposes a basicHttpBinding endpoint, then you should be able to consume it in a .NET 2.0 application by using "Add Web Reference".

Related

Call a gRPC HTTP/2 service from a .NET Framework application without using TLS

I have a .NET Framework application which cannot be ported to net core for various reasons. Now I want to switch from Grpc.Core to Grpc.Net.Client because the first one gets deprecated.
May application makes a gRPC request to a service written in C++ which does only support HTTP/2 and does not provide TLS. According to here this connection is not supported: "Only gRPC calls over TLS are supported.". I can confirm this so far.
Is there any way to call a gRPC HTTP/2 service from a .NET Framework application without using TLS?
You could make a proxy service in which you call original gRPC with TLS.
Than from your application call this proxy service which doesn't have those restrictions.
Your app <--> proxy service <--> gRPC
Proxy service - implemented in one language you like and exposed to your application.
This is one posibility.

Grpc-Web Application hosting in IIS

I have created a sample Grpc application with a basic ado .net query and I want to host the same in the IIS. The application works fine when I consume it from a net client but after hosting, I am getting an error in the client application when I try to consume the grpc endpoint.
'Status(StatusCode="Unimplemented", Detail="Bad gRPC response. HTTP status code: 404")'
I have created an entity a grpc app with ef core and a WCF service with EF6. when I compare the response times, the WCF service seems to respond quicker than grpc app. Am I missing anything?

WCF connect to Websocket server

Which library should i use to connect my WCF Service (remote) to a Websocket server ?
I found this library Microsoft.ServiceModel.Websocket.dll but i didn't found how to use in the case where the webservice is the client and not the server.
PS : I'm using .net 4.0.
Thanks!
You would need a WCF binding with websocket protocol support. Unfortunately it doesn't exist in .net 4.0.
It will be available in .net 4.5, though.

WCF service (.NET 4.0) can have a .NET 2.0 client?

The scenario is like this:
I have a .NET 4.0 client-Server application that works fine.
I need to create a UserControl that can access the Server, but it needs to be created in .NET 2.0 (because customer application is .NET 2.0)
Does it exist a way to access .NET 4.0 WCF service from a 2.0 client?
NOTE:
it is not a Web service, but a standalone .exe server
No autentication used
Data transfered are almost basic (class with arrays and basic types within)
it uses client callbacks so protocol il net.tcp
optionally I can change protocol if I can still be able to use callbacks
You need to expose the WCF as a Web Service:
How to: Expose WCF service also as ASMX web-service
Expose WCF Service as Traditional Style Web Service .asmx
The you work as if it was a good old .asmx service (add reference and so on).
It doesn't matter if your WCF service is hosted in a .exe, a web app, a windows service...
Supporting callbacks is not possible in .NET 2.0 with .asmx services, so that you have to simulate a callbak using something like TcpListener and TcpClient.
Unfortunately this has to de done from scratch, but you can use the logic in the WCF implementation.
If your WCF 4.0 service is using basic http binding, you can use it in .NET 2.0 or in any other language.
Just use WSDL.exe to generate the proxy and use it in .NET or in any other language.
Yes you can use the WCF service in .net 2.0 client by adding the reference of the .cs file (proxy class) in your client project.
Question solved a while ago.
Well, not really solved...
After looking at an article about performance on .NET WCF, I decided to use .NET remoting.
It is faster, compatible native .NET 2.0 and it works.

Can I run a program that consumes a WCF service on Windows 2000?

We're hosting a WCF web service on a server running the latest version of Windows Server.
We have many different clients running different versions of Windows. For example, 2000, XP, Vista and a couple of Windows 7.
Can I run a program that consumes a WCF service in Windows 2000? What do I need for a WCF service to run well on the client side?
A WCF service can be consumed by any client that can communicate with SOAP. The performance of the WCF service has nothing to do with the client OS. If performance is an issue with the WCF service it is most likely a connectivity or bandwidth issue from the client to the server. How you choose to consume the service is up to you. The WCF service will continue to run on your server and perform any methods you invoke from the client on the server.
Its very hard to answer your question without knowning the requirements of the web service which is exposed on the 'latest version' of windows.
The most important part of this will be "which binding(s) is/are being exposed by the WCF service".
If this is 'basicHttp' or 'wsHttp' you will be able to communicate with this service using a .Net 2.0 client (wsdl.exe proxy). If this is not the case, it will become harder to implement.
Bottom line; a Web Service is not tied in to the development platform it has been written on. The real important part of a web service is it's contract (which is described by WSDL). If the contract exposed can be consumed by .Net 2.0 tools, you can communicate.
If they cannot, you either have to use 'extensions' (like WSE) or go the manual route which i both advise not to take!
ps; WCF != WebServices. WCF is a toolkit that can be used to build a web service or rest service. "Traditional webservices used the Basic Profile 1.1" which consist only of XML, XSD, WSDL and SOAP.
hope this helps,

Categories