hosting in IIS

May 20, 2008 at 3:16 AM
Hi Daniel,

Im trying to host Clog in IIS using the configuration below.

LoggingService.svc:
<%@ ServiceHost Language="C#" Debug="true" Service="Orpius.Logging.ClogService"%>

web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="Orpius.Logging.ClogService"
               behaviorConfiguration="LoggingServiceBehavior">
        <endpoint address ="http://localhost/LoggingService"
                  binding="wsHttpBinding"
                  contract="Orpius.Logging.IClogService">
        </endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="LoggingServiceBehavior">
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Using a web browser this seems to work fine. I can see the service page at http://localhost/Loggingservice/Loggingservice.svc
Unfortunately my test client wont work. It ends up with a System.ServiceModel.ProtocolException: (405) Method Not Allowed.
The Testclient has a service reference and simply runs following code:
using ConsoleApplication1.ServiceReference1;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            ServiceReference1.ClogServiceClient c = new ClogServiceClient();

            c.WriteEntry("help!");
        }
    }
}

The exception is thrown at c.WriteEntry("help!");
Do you have any idea what could be the reason ?

cheers,
Matthias
(If it does  matter: Im running theese tests on Windows Vista)
Coordinator
May 20, 2008 at 9:50 AM
Edited May 20, 2008 at 9:56 AM

Matthias,

Try passing an instance of LogEntryData rather than a string.

Daniel