Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a WCF Web Service which I'm trying to install on IIS7.5 on Windows 7. I can browse the service home page just fine, but trying to call any of the methods from the WCF Test Client produces a 405 error:

The remote server returned an unexpected response: (405) Method Not Allowed.

Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at IServiceRequest.RaiseServiceRequest(ServiceRequestEntity request)
   at ServiceRequestClient.RaiseServiceRequest(ServiceRequestEntity request)

Inner Exception:
The remote server returned an error: (405) Method Not Allowed.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

I enabled failed request tracing and the error (actually just a Warning) comes from the DirectoryListingModule:

ModuleName             DirectoryListingModule 
Notification           128 
HttpStatus             405 
HttpReason             Method Not Allowed 
HttpSubStatus          0 
ErrorCode              2147942401 
ConfigExceptionInfo
Notification           EXECUTE_REQUEST_HANDLER 
ErrorCode              Incorrect function. (0x80070001) 

This would seem to imply the service request is being incorrectly interpreted as a directory listing, which in turn indicates that something has gone awry in module registration. I have run aspnet_iisreg.exe -i and ServiceModelReg.exe -i and rebooted, but that doesn't seem to help. The process for disabling the DirectoryListingModule seems to me to be overly complicated for what should be a straightforward set up.

All of the posts I could find which mentioned a similar issue ("wcf 405 DirectoryListingModule") either have no answers or finish up with something along the lines of "I tried installing on a different machine and it worked."

Does anyone know how to get this working?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.