I have small question,
If I host NetTcpbinding WCF service in IIS 7.0 and I want to invoke this service from Client application, then what format this will be used fo communication..??
Is there any rule saying that, all NetTcpbinding should not host on IIS instead they have to host on Console application or windows service..??
When extactly I want to go for TcpNet binding..??
Suppose, I have two endpoints one for WsHttpbinding and other one is NetTcpbinding and deploy Service in IIS then If I want to use NetTcp endpoint from Client application then how..?? Is this correct way to do...?? in this scenario...
Thanks,
Sukesh.
NetTcpBinding Class info:
http://msdn.microsoft.com/en-us/library/ms576421.aspx
Quoted from the remarks:
The NetTcpBinding generates a run-time communication stack by default, which uses transport security, TCP for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for communicating over an Intranet.
Quote indicates that a Client-Server connection is established via TCP and this is used to send the SOAP Message encoded in binary.
2.
No. There is even this nice blog post on how to do it:
http://blogs.msdn.com/b/santhoshonline/archive/2010/07/01/howto-nettcpbinding-on-iis-and-things-to-remember.aspx
3.
Back to the class info:
More generally, the HTTP system-provided bindings such as WSHttpBinding and BasicHttpBinding are configured to turn things on by default, whereas the NetTcpBinding binding turns things off by default so that you have to opt-in to get support, for example, for one of the WS-* specifications. This means that the default configuration for TCP is faster at exchanging messages between endpoints than that configured for the HTTP bindings by default.
This means that this binding doesn't do all the higher level processing that basicHttpBinding and WSHttpBinding do due to the additional protocol layers expected (http layer and WS-* spec layer). So this is a higher performance binding configuration giving you a faster turn around time in your service message replies at the cost of losing your http layer (clients can no longer just HTTP POST soap envelopes to your service).
4.
I would set up two separate service endpoints(one TCP and one WSHttp) that implement the same interface. Then you can set up two client config items on the client end that again use different binding configuration but call to the same interface. Then you can just load either.
<client>
<endpoint name="WSEndpoint" address="http://address/WSEndpoint.svc" binding="WSHttpBinding" contract="Your.Contract.Namespace"/>
<endpoint name="TCPEndpoint" address="http://address/TCPEndpoint.svc" binding="NetTcpBinding" contract="Your.Contract.Namespace"/>
</client>
Related
I have created a .NET 4.0 WCF service to transfer large files from and to clients. Several sources in the web suggest that streaming via netTcpBinding performs significantly better than streaming via basicHttpBinding (streaming, mtom enabled).
On the other hand, establishing a connection to the server via net.tcp is reported to be prone to fail, in most cases due to firewalls, proxies or other company networking restrictions, while establishing a http connection on port 80 can be taken for granted.
What I'd like to do is to provide the streaming service with both http and net.tcp endpoints on the server side. The client tries to connect to the net.tcp endpoint, and in case of a connection error, connect to the http endpoint.
Is there a way to share port 80 between my http and net.tcp endpoints? I'm using IIS 8 as service host, the clients are tied to .NET 4.0, denying the use of .NET 4.5's newly introduced NetHttpBinding.
You can share ports between multiple basicHttp bindings, or between multiple netTcp bindings, but unfortunately you can't mix and have both netTcp and basicHttp share a port. WCF will give you an AddressAlreadyInUseException for that.
We need to create a WCF service (.NET 4.0) that will be consumed by a client outside of our organization.
The case is that we have two servers that are behind a load balancer which terminates the SSL. This is where it gets confusing for me.
How we could and should handle the authentication?
The previous experience about WCF is only about services for internal use. If I understood correctly we should use basicHttpBinding to guarantee interoperability with Java based client. I don't know if this is an issue with JAX-WS based client.
There will only be this one client that is going to use the service.
We need to somehow ensure that caller is authenticated to use the
system
Make sure the message is encrypted when moving in public network
So far the best article that I found was
http://devproconnections.com/net-framework/wcf-and-ssl-processing-load-balancers
There were few suggestions how to do this.
WCF services can be configured for basic authentication and receive credentials in the clear over HTTP. This can work; however, it precludes passing credentials in the message, and the use of more interesting credentials (such as issued tokens).
We use forms authentication on our website under which the service will be hosted. I think it is not easy or even possible to make the service then use basic authentication.
WCF services can be configured to fake the presence of transport security so that the runtime will allow receiving message credentials without transport or message protection
Will this be the way to go and will this work with basicHttpBinding?
The client and server binding will be different. The client binding will use username auth in eitehr message or transport level with transport security (ssl):
<bindings>
<basicHttpBinding>
<binding name="NewBinding0">
<security mode="Message" />
</binding>
</basicHttpBinding>
</bindings>
then the server config will use the same config but without the transport security. If you chose to use message security then check out WCF ClearUsernameBinding. If you use trasnport security (basic http) then set mode="TransportCredentialOnly".
I have a WCF Polling Duplex Service for silverlight clients. I wanted to add Reliability to the service but first I got this error.
The message version of the outgoing message (Soap11
(http://schemas.xmlsoap.org/soap/envelope/) AddressingNone
(http://schemas.microsoft.com/ws/2005/05/addressing/none)) does not
match that of the encoder (Soap12
(http://www.w3.org/2003/05/soap-envelope) Addressing10
(http://www.w3.org/2005/08/addressing)). Make sure the binding is
configured with the same version as the message.
I changed the config files and I'm now getting the error below. Is reliability supported in WCF Polling Duplex?
Unrecognized element 'reliableSession' in service reference
configuration. Note that only a subset of the Windows Communication
Foundation configuration functionality is available in Silverlight.
I think the problem isn't the usage of WCF polling duplex, but Silverlight in general. It supports only a subset of WCF and according to this article reliable sessions are not supported. A quotation:
"More advanced bindings and binding elements, such as the ones dealing with queues, reliable sessions, transactions, message-level security (such as WS-Security), peer-to-peer messaging, and transports other than HTTP, HTTPS, and TCP are not provided in Silverlight 4."
I am hosting a WCF service in IIS 7 through net.tcp binding. I have two questions about IIS configuration.
Can I only configure net.tcp protocol in the the web site containing my service code? All the samples I found so far always append the net.tcp protocol after http protocol.
There are two features we can turn on: Windows Communication Foundation Http Activation and Windows Communication Foundation Non-Http Activation. Some sample state that we need to turn on Non-Http activation and others state that both are required to turn on. My test shows that both are required. However, I do not understand the difference between the two. If only net.tcp protocol is used by my service and client, why should Http Activation be required?
Even if your service is net.tcp the meta data exchange that is used when you add a service reference may be http.
Which tests did you do? If you need more help post your config file.
In one of our networks we are utilizing the netTCPBinding. The WCF service hosted in windows service that run as a domain account.
From the event viewer I can see that my WCF service uses Kerberos authentication. Everything works seamlessly "out-of-the-box" with simple default configuration without an <identity> element in the configuration file and without any SPN setting for the machine like:
setspn -a WcfServiceName//Server domaonAccount
But from the multiple online references I concluded that SPN setting is necessary
Its not clear, why in my case it works without those settings?
Looking forward for an explanation from WCF-Security experts.
Per the WCF Security Guidance:
netTcpBinding : Specifies a secure, reliable, optimized binding suitable for
cross-machine communication. By default, it generates a runtime
communication stack with transport security and
Windows authentication as default security settings. It uses
TCP protocol for message delivery, and binary message
encoding.
In essence, its secure by default, callers must provide Windows creds for authentication.