Method not allowed running a simple indigo service (Solved)

I'm using Visual Studio .Net 2005 Beta 2 and the September CTP of WinFx to develop some samples using the WCF technology.
I've built a simple ping service, and i'm hosting it in the cassini web server included in visual studio. I'm consuming the service from a simple console application.
I've disabled dynamic ports on the server and i'm running my service in port 8080. Everytime that i try to run the service i get the following message : "The remote server returned an unexpected response: (405) Method not allowed.".
This message appeared after disabling NTLM authentication in the Start Options of the service. I have disabled NTLM authentication because i was getting this error : "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The server authentication schemes are 'NTLM'." (i have found this info in Steve Maine's blog athttp://hyperthink.net/blog/default.aspx)

Client.cs :



using System;
using System.ServiceModel;

namespace WCFClient
{
class Client
{
staticvoid Main(string[] args)
{
using (PingServiceProxy proxy =newPingServiceProxy())
{
Console.WriteLine(proxy.Ping("Hello"));
Console.ReadLine();
}
}
}
}


PingService.cs :



using System;
using System.ServiceModel;

[ServiceContract]
publicinterfaceIPingService
{
[
OperationContract]
string Ping(string msg);
}

publicclassPingService :IPingService
{
publicstring Ping(string msg)
{
return"Msg:" + msg;
}
}

Server Web.config :

<?xmlversion="1.0"?>
<
configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<
system.serviceModel>
<
services>
<
servicetype="PingService">
<
endpoint
address=http://localhost:8080/WCFService
contract
="IPingService"
binding="basicHttpBinding"/>
</
service>
</
services>
</
system.serviceModel>
<
system.web>
<
compilationdebug="true"/>
</
system.web>
</
configuration>

Client App.config :

<?xmlversion="1.0"encoding="utf-8"?>
<
configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<
system.serviceModel>
<
client>
<
endpoint
address=http://localhost:8080/WCFService/
binding="basicHttpBinding"
contract="IPingService"/>
</
client>
</
system.serviceModel>
</
configuration>

Tnks for any help, i'm getting nuts with this problem :-(

[10223 byte] By [IvoLeit?o] at [2008-2-17]
# 1
Ok i have solved the problem, i have made an error on the endpoint address in the client App.config, it should end with /service.svc :
Server Web.config :

<?xml version="1.0"?>
<
configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<
system.serviceModel>
<
services>
<
service type="PingService">
<
endpoint
address=http://localhost:8080/WCFService/service.svc
contract
="IPingService"
binding="basicHttpBinding"/>
</
service>
</
services>
</
system.serviceModel>
<
system.web>
<
compilation debug="true"/>
</
system.web>
</
configuration>
IvoLeit?o at 2007-9-8 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2

Excuse me, I have the same problem with you. but when I add the "/Service.svc" on the end of address, I get the following message:

The message with To 'http://localhost:8000/atm/Service.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

Anybody can help me ?

No.1OfMew at 2007-9-8 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 3

I had this same issue; my client config file service endpoint was "http://localhost/MyService/service.svc" and the service web.config endpoint was "http://localhost/MyService". Adding the "/service.svc? resolved the EndpointAddress exception for me.

Hope that helps!

cheers

jk

JeffKnutson at 2007-9-8 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified