WCF service streaming - Console host vs. IIS host - wcf

I've created a streamed wcf service based on that example: http://www.codeproject.com/Articles/112655/Progress-Streamed-File-download-and-Upload-with-Re
With console host works everything fine, the upload and the writing run "parallel". But if I host the service in IIS, it seems, that the stream is buffered on the server side.
Why? What is the difference? Is the service with console host not reliable?! (I need reliable streming!)
How can I avoid that with IIS host?

How do you know its buffered? Check the config file on the client side after proxy generation. Sometimes the proxy generated config file has incorrect transfermode.
When you start writing the file on the client, don't any see any chunk wise increase in the size of file?
The hosting shouldn't affect the transfermode.
The only difference between IIS and Console would be the way activation/deactivation is managed.

I've found it: Getting Streaming in IIS Hosted WCF service to work
I think this is a known issue (streaming with .net 4.0 and iis 7).
When a WCF service using streaming is hosted in IIS then ASP.net
buffers the request at its layer. The request does not even come up to
WCF until ASP.Net is done with it.
This should work when using non-HTTP transport IIS or hosting in a
non-IIS host.
(Zulfiqar Ahmed)
on contacting the product team - they said it would be fixed in .NET
4.5 as its too big to be issued as a patch.
And it works with .NET Framework 4.5

Related

Is it possible to host dache cache on IIS?

I'm developing a Web App with Dache, Thanks the author for the fantastic library.
Unfortunately, I have a big problem with it.
In previous version of 1.5.6, it was worse. but in 1.5.6 it's better but still I get The following exception:
There are no reachable cache hosts available. Verify your client settings and ensure that all cache hosts can be successfully communicated with from this client.
In developing, I get the exception after 2 or 3 times build, and I have to restart cache service and stop IIS Express to remove the exception.
In the web app after some hours the clients disconnect from cache service. and I have to restart the cache service and web sites to remove the exception.
I hosted dache on windows service.
I think the problem is for comunications between dache host and dache clients.
So, Is it possible to host dache cache on IIS like a WCF service instead of windows service?
You can host Dache in your own process using the Nuget package. More information available on the Dache wiki:

wcf service on windows 2003 server - works as server but not as a consumer/client

It is a very simple wcf service. Since my original wcf service didn't work there I decided to create one test service. Basically I'm using the default method GetData(int).
I hosted this service on windows 2003 server. It works well when I consume it from a different machine. I use a windows forms test application to consume this service. When I run this forms app on the same ws2003 server and attempt to consume the service on the same server it throws the following error:
There was no endpoint listening at http://...
I created another wcf client using asp.net, also silverlight, nothing works.
Basically, it looks like it can't consume any wcf service.
I couldn't figure out what could be the issue.
Basically, the machine had McAfee antivirus installed and was blocking http communication to aspnet_wp.exe.
The full path is c:\windows\microsoft.net\framework\v4.0.30319\aspnet_wp.exe
Everything works fine after unblocking this specific exe.

Host WCF service with net.tcp binding through IIS Manager 7.5

I am fairly new to hosting web applications and web services. Though I was successful in hosting a web application, I am running into road block after road block when trying to host a WCF service with net.tcp binding.
My scenario is as follows, I have a hosted web application that needs to communicate with a hosted WCF service with net.tcp binding through IIS 7.5. As stated the web application is hosted fine and I can browse the web site. However, the web application makes services calls to the WCF service and I am getting the 'TCP error code 10061' message which I believe is due to my hosted WCF service not running. I think this is not running because I attempt to 'telnet localhost 808' to see if the WCF service is running and it is not. I've run through numerous online guides and I still have had no luck. I believe I may be doing something fundamentally wrong with me being a noob and all. I am able to host the service through VS2010 and run the web application and it works fine so I believe my bindings are correct. I've also enabled tcp protocols on both websites in IIS Manager.
So I guess my real question is what are the IIS Manager steps needed to host a WCF service with net.tcp binding? It appears to me that it is not possible to host a net.tcp service through IIS Manager by simply creating a website because IIS Manager wants to bind to an http port.
Here are some things to check:
Ensure the Net.Tcp Listener Adapter windows service is running
Ensure netTcp is listed as an enabled protocol for your website (In IIS Manager, go to Advanced settings for your site)
Ensure netTcp is listed as an enabled protocol for application (directory) that is hosting your services (In IIS Manager, go to the directory hosting your services and select Advanced Settings)
Ensure your IIS site has a binding for net.tcp, with the correct port number listed.
EDIT:
See the following MSDN page for enabling/using non-HTTP bindings in .Net 4 + IIS 7/7.5:
Configuring the Windows Process Activation Service for Use with Windows Communication Foundation
And I discovered that for me it didn't work to use localhost... You should use 127.0.0.1 or the name of your computer.

Unable to host a Service Bus WCF Host in IIS on Azure

I have worker roles that send out multicast messages using the azure service bus. Two of the consumers of these messages are websites hosted on Azure. I know that there are issues hosting service bus WCF endpoints in IIS even when running on premise. I've followed the Microsoft's advice and configured a service host programmatically.
One of the websites has been using this technique successfully for quite a while. It uses the hosted web core (it was developed before full IIS was an option on Azure) and it initialises the service host as part of the RoleEntryPoint.OnRun(). I'm trying to move this site to using full IIS. Because in full IIS the RoleEntryPoint runs in a different process to the site itself and the service host needs access to some static variables in the site I've moved the initialisation of the service host to the Global.asax Application_OnStart. This code works fine when running as a website under IIS locally and it runs fine when running in the compute emulator, but once I deploy it to the cloud my WCF host never seems to receive any messages. I haven't been able to catch any errors that are occurring.
Has anyone else out there successfully deployed something like this?

wcf pollingduplex connection limit in silverlight 3.0

I have build a silverlight application for message service. my problem is silverlight application disconnect after 10 connection. But i want it unlimited or thousands. I have spent a lot of time on this problem. some point about my application as:
I have build 3 prject like silverlight project, web project, wcf service project.
Im using PollingDuplexHttpBinding in wcf.that configure with we.bconfig.
In silverlight project i have add service refrence and create service object with pollingduplex binding.
I have configure web.config of wcf service project like :
I have test this project on iis6 server 2003 server but problem same.
please help me to sole this problem.
Thanks
The problem is the number of concurrent threads IIS can run (sounds like you have it configured to run 10 at the moment). You can increase that number through IIS configuration...but performance is going to suffer.
The problem is that Duplex Services hosted in IIS never release their threads...so every user connected to the service sucks up another IIS worker thread. Duplex performance has been discussed elsewhere, but the common tone is this:
IIS can not host scalable Duplex Services.
My suggestion would be to find another way to host those services (WCF outside IIS, Custom Web Server, etc.).
Good luck.
I noticed that my PollingDuplex-software had limit of 10 clients when using one Internet Explorer. The limitation was still there with Windows 2008 Server R2 machine and Web.config having many settings:
for binding: binding name="pollingDu​plexBinding" maxConnections=​"100"
for serviceBehaviors behaviour: serviceThrottli​ng maxConcurrentCa​lls="1000" maxConcurrentIn​stances="1000" maxConcurrentSe​ssions="1000"
and for pollingDuplex maxPendingSessi​ons="2147483647​" maxPendingMessa​gesPerSession="​2147483647"
But then when I tried with different clients:
6 clients on IE on server
6 clients on IE on a different client machine
4 clients on FireFox on this client machine
And it worked. So, there is some kind of limit with same client connections.