开发者

WCF Server returning "Content-Length: 0"

Greetings,

I create a new project (in VS2010) using;

File -> New Web Site -> .NET Framework 3.5 -> WCF Service

Service works great via Cassini, can view the WSDL metadata with success. Then I attempt to setup the application to be served via IIS. Using a .NET 2.0 application pool with "Integrated" pipeline.

I made sure the svc handler is setup on the application (both managed and script) and ran this command as well:

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /r

Then when I attempt to view the service metadata via the IIS service I get this (text from a Fiddler session);

GET http://localhost/WCFService2/Service.svc HTTP/1.1
Host: localhost
Connection: keep-alive
Accept:   application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like     Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

HTTP/1.1 200 OK
Server: Microsoft-IIS/7.5
X-Powered-By开发者_JS百科: ASP.NET
Date: Wed, 12 Jan 2011 19:04:43 GMT
Content-Length: 0

I was getting a HTTP Error 500 but I changed the permissions on all the files in the folder to "EveryOne" and "full" - just to remove any security issues. Its after this action that the error 500 stopped but the empty content started.

I am using Windows 7 64 bit, VS2010 and have v2.0, v3.0, v3.5 and v.4.0.30319 frameworks installed. I hoped that it would work as simple as this screencast, silly me.

Any suggestions?


Try enabling static content support from "Windows features on or off", this is most likely what is causing the problem.

If the "Static Content" is not enabled the IIS will return a response with Content-Length = 0

Go to Control Panel >>

Programs And Features >>

Turn Windows features on or off >>

Internet Information Services >>

World Wide Web Services >>

Common HTTP Features >>check Static Content.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜