I wanted to ask is it possible to change format of message in netTcpBinding to not use Soap. I know it is possible with webHttpBindng but I want to know about netTcpBinding.
My belief is that NetTcpBinding itself is SOAP based; however, one can create custom binding using TCP transport of WCF to implement something own.
Related
I have WCF Service with nettcpbinding endpoint , how can I consume this service in WP8?,
I don't want to use sockets because I don't want to change the implementation of my service, is there any way to consume the service using sockets?
Will nettcpbinding be supported in the next versions of WP8, if yes then when?
I not using WCF (but that *.asmx), Its more simple type of services but this solution maybe work too for you
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580%28v=vs.105%29.aspx
You can implement it yourself.
It's not that hard, and the protocol stack is well-documented.
See this article for an overview.
WP7-8 already includes binary XML serialization used by nettcp, namely XmlDictionaryReader and XmlDictionaryWriter classes. So, you only need to implement the lower-level pieces of the protocol, i.e. the framing protocol, and SOAP envelopes.
I have a RESTful service which is exposed via WCF with the webHttpBinding.
I am now asked to get the TCP header (specifically the packet TTL). The difficult approach will be to switch to the net.tcp binding and handle all the HTTP layer by myself.
There must be an easier way... Please help!
As you've found out, WCF abstracts the message transport (TCP, HTTP, ...) by implementing the binding concept (netTcpBinding, basicHttpBinding, ...). The benefit is to be able to easily (most of the time) change bindings without affecting the service code. The trade off for this ease is hiding the transport details from service code. In fact, its fairly difficult to get the client IP address in WCF.
On the other hand, WCF is so extensible that you can "re-implement" the webHttpBinding as a custom binding so you can bubble up the TCP info you want. This SO question & answer will give you a start on a custom binding but you'll likely need to create a custom HTTP transport component to access the TCP details. When a tool makes you work this hard, there's a good chance you're using the wrong tool. Just sayin' ... :)
At first I had to make 2.0 work with WCF service. I accomplished that using BasicHttpBinding . Since BasicHttpBinding doesn't support Duplex callback, I can't make the server ping the client. Any ideas????
Thanks
If you want WCF to do this, it's not possible over the BasicHttpBinding. You need wsDualHttpBinding or NetTcpBinding if you wish to establish a callback channel out-of-the-box with WCF. You can also try to write a CustomBinding, but utilizing .NET 2.0 for the client is going to limit what you can do.
I know you can use multiple bindings, but if you implement a REST Service, must you use the webHttpBinding?
The webHttpBinding is what tells the WCF framework to communicate in a RESTful fashion - any other binding would define a different protocol. In your comment, you ask about wsHttpBinding - If you used that binding, you would not have a REST service, you'd have a SOAP web service.
You don't need to use directly WebHttpBinding. You can also use custom binding or your own binding but these bindings have to use HttpTransportBindingElement and WebMessageEncodingBindingElement. Both these binding elements are used by WebHttpBinding.
For my project's web services I want to support desktop clients and silverlight clients. Should I write a separate web service for each or put all the operations in one service? If I put them all in one, I have to go with basicHttpBinding. The winforms app uses wsHttpBinding now, what do I lose going with basicHttpBinding?
I very strongly recommend you read this thoroughly:
"Silverlight and WCF Feature Comparison"
http://msdn.microsoft.com/en-us/library/cc896571(VS.95).aspx
There are quite a few gotchas when developing a web service for silverlight usage, especially if you already have a wsHttpBinding solution. Good luck!
EDIT: also I found this article useful:
WCF : BasicHttpBinding compared to WSHttpBinding at SOAP packet level
http://geekswithblogs.net/claeyskurt/archive/2008/04/22/121508.aspx
Use one web service with two endpoints, that would allow you to support basicHttpBinding as well as wsHttpBinding.
The difference between the two bindings is that basic is Soap 1.1 whereas ws is Soap 1.2 and WS-Addressing Specifications, in addition wsHttpBinding offers more security options