wsHttpBinding on the wcf service and web reference on the client don't work - wcf

I am using wsHttpBinding with a WCF service.
I've added a web reference and I've got the web proxy (it is based on SoapHttpClientProtocol).
Also I've tried to build a proxy using wsdl.exe and the actual wsdl generated by the wcf service (http://zzzz/zz.svc?wsdl).
When the client calls the service, I get the following error:
The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/Service1/Operation1'.
Why doesn't the client (the web proxy) work with my WCF service?
What steps should I take to make them work?
I am running .NET FW 3.5 and ASP.NET 2.0.

You cannot consume service exposed on wsHttpBinding with default configuration by old ASMX proxy. You must either use add service reference / svcutil or change your binding to basicHttpBinding. Default configuration of wsHttpBinding uses advanced security and ASMX doesn't support it.

Related

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.

.NET Remoting and WCF

I have an old ASP.NET app connecting to a .NET Remoting service. I'd replaced the .NET Remoting service to a WCF service. I have the original WSDL and I've generated a WCF service by the help of svcutil. I don't know whether the client will able to connect and call the WCF service without changing its code.
Is it possible to solve this problem, please?
A service can be both a remoting service and a WCF service at the same time.
Just configure it with RemotingServices as usual for remoting.
Then decorate with OperationContract / ServiceContract and construct with ServiceHost and you can create clients for both techniques, just that remoting is TCP only.
WCF and Remoting are different paradigms. So if you changed your Remoting server to .NET WCF service, you will have to change the client code to use the wsdl generated client
look at https://learn.microsoft.com/en-us/dotnet/framework/wcf/migrating-from-net-remoting-to-wcf#Client_Comp. it should not be difficult

In WCF can I expose webHttpBinding Restfull and NetNamedPipeBinding at the same time which is hosted in IIS

Am creating a WCF service which will be hosted in IIS 7. Can I expose webHttpBinding for Json communication and also netNamedPipeBinding for internal to the system
No, It's not allowed to have two types of protocol on single WCF service in one hosting process on IIS. The reason is that for WebHttpBinding you would need to use AspnetcompatibilityMode which allows WCF to be hosted side by side in Asp.net app domain and allows functionalities like Routing, access to HttpContext.Current.
Other binding types won't be supported with other types of biding if you have Aspnetcompatiblitymode enabled. For more details read the MSDN documentation here.

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.

I can't access wcf service using net.tcp://<servicename>

I'm using IE8 and can't connect to my WCF service using net.tcp. I'm able to access the same service with http binding just fine. I got two binding enabled in app.config (net.tcp, http). Can anyone tell me if there is a settings that I need to set/play with for viewing service using net.tcp in IE.
You cannot connect to a WCF service using the netTcpBinding through IE.
What you need is a "real" WCF client app, or something like WCF Test Client which is shipped with WCF in the box - just find it and start using it!
Make sure you have a HTTP base address, for your service and a mexTcpBinding endpoint.