p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Windows Communication Foundation (http://p2p.wrox.com/forumdisplay.php?f=207)
-   -   getting plain text for .svc file (http://p2p.wrox.com/showthread.php?t=49814)

bhavsac November 3rd, 2006 10:15 AM

getting plain text for .svc file
 
I was getting plaint text for all .svc files from IIS. I used CleanIISScriptMaps.exe tool to clear ScriptMaps. Still .svc is not supported for some virtual directories. For one .svc file I am getting proper service description but for another I am getting plain text. How to resolve the problem?


Regards,
Chandrak

SQLScott November 3rd, 2006 10:33 AM

Hi Chandrak,

What are you using to create the .svc files? Are you using the built-in VS templates?

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html

bhavsac November 3rd, 2006 10:42 AM

Hi Scott,

Thanks for your reply.

.svc file is xml file hardly of one line so I am just copying it from the existing project. for example <%@ServiceHost language=c# Debug="true" Service="DerivativeCalculatorService.CalculatorSer vice" %>. It contains the name of the service hosted in IIS.

Regards,
Chandrak

SQLScott November 3rd, 2006 11:41 AM

Right, I think you can't just copy it, because IIS needs to know "This is a WCF Service" so that it knows to use the .svc file. I will look at something and get back to you.


Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html

SQLScott November 4th, 2006 12:15 PM

Hi Chandrak,

I apologize for taking so long to back with you on this. I had to find what I was looking for.

OK, you need to add a mapping for the .svc file. In IIS, right mouse click on the web site that isn't working, and select properties. On the Virtual Directory tab, click the Configuration button. That will bring up the Application Configuration screen. On the mappings tab, under the Appliction Extenstions, look to see if you have an entry for the .svc extension.

If you don't, you need to add one, and map it to the aspnet_isapi.dll.

To do this, simply click the Add button and browse to the isapi dll and enter an extension of .svc.

You should be good to go!

Let me know if I can help you with anything else.



Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html

bhavsac November 6th, 2006 01:45 AM

Hi Scott,

Thanks for your help. But the mapping for .svc file is there in both applications. And both are mapped to the same aspnet_isapi.dll.:(

Regards,
Chandrak

SQLScott November 6th, 2006 12:14 PM

What error are you receiving? From you posts, it looks like you are creating multiple applications in IIS, correct?

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html

bhavsac November 7th, 2006 12:31 AM

Hi Scott,

Yes I have one application which is sample from microsoft. Another application is the one I am creating. If I browse the .svc file of sample I am getting proper service description but if I browse the .svc file of the one which I created then I am getting text displayed from .svc file. Sometimes if I browse to that .svc file then I get "Server Application Unavailable" errror.

Regards,
Chandrak

SQLScott November 9th, 2006 02:27 PM

How did you create your application? Meaning, how did you create teh IIS application? You are missing some configuation that tells your application that it is a WCF service application. I would suggest looking at the differences between the Microsoft setup and your setup.

In fact, you had to run a command file, if I am not mistaken, to propertly set up the Microsoft sample. There is probably some step in the command file that you have not done on our setup.

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html


All times are GMT -4. The time now is 05:49 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.