WCF GET REQUEST返回405方法不允许 [英] WCF GET REQUEST returns 405 method not allowed

查看:77
本文介绍了WCF GET REQUEST返回405方法不允许的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题摘要:托管WCF服务的Windows服务程序非常相同:



1)在我们的Windows Server 2008服务器上完美运行

2)用于工作,但现在无法在我的笔记本电脑上工作

3)从未在我的新桌面上工作过。



我有一个运行WCF WebGet服务的Windows服务。此服务不使用IIS。该服务非常适用于我们的Windows Server 2008(32位)。它也常用于我的开发笔记本电脑Win7(32位)。



然后大约九个月前我买了一台Win8 64bit工作站作为后备开发计算机。上面提到的服务器上的相同服务使用installutil正确安装并且启动正常。但是,当我向服务提交获取请求时,我收到以下响应:



远程服务器返回了意外响应:(405)方法不允许。



为了复合一些东西,没有使用笔记本电脑上的服务(Win7 32bit)几个月,我最近需要做一些开发工作以及以前的服务在这台计算机上工作,我现在得到与上面相同的响应消息。我没有在笔记本电脑上有任何改变,服务程序和以前一样。开发工作现在非常麻烦,因为我必须将新版本复制到服务器并在那里进行测试。



我原本以为这是64位或Win8的问题,但现在问题已经蔓延到我的Win7 32位开发计算机,这个想法似乎不太可能。我开始认为这是我们亲爱的微软朋友推出的一些kb,我虔诚地安装了它。



我读过我能找到的每篇文章但是他们关于iis的所有问题。现在我知道这看起来像是一个iis响应,可能是,但我想知道的是(1)为什么我的笔记本电脑开始以不同的方式处理服务请求;(2)我能做些什么才能回到原来的位置?毫无疑问,答案将帮助我弄清楚为什么服务从未在我的后备计算机上运行。这就像强迫我的所有请求进入iis,我绝对不希望发生这种情况。



app.config文件包含服务跟踪块,它已经可靠地工作(当没有获得405响应时)。如果我有405响应,则不会在服务跟踪日志中输入任何条目。



我会非常感谢您提供正确的帮助。我应该强调我的解决方案是Windows服务,而不是Web应用程序,我的解决方案有app.config文件而不是web.config(就像Web应用程序一样)。





非常感谢,



马尔科姆

Summary of the problem: The very same windows service program hosting WCF services:

1) Works flawlessly on our Windows Server 2008 server
2) Used to work, but now doesn't work on my laptop
3) Never worked on my new desktop.

I have a windows service that runs WCF WebGet services. This service does NOT use IIS. The service works on our Windows Server 2008 (32 bit) perfectly well. It also used to work just as well on my development laptop, Win7 (32bit).

Then about nine months ago I bought a Win8 64bit workstation as a fall-back development computer. The very same service on our server mentioned above installs correctly using installutil and and starts up fine. However, when I submit a GET REQUEST to the service I get the following response:

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

To compound things, not having used the services on my laptop (Win7 32bit) for several months, I recently needed to do some development work and where the services used to work on this computer, I now get the same response message as above. I haven't wittingly changed anything on the laptop and the services program was the same as before. Development work is now very cumbersome as I have to copy the new build to the server and test it there.

I originally thought this was an issue with 64bit or Win8, but now the problem has spread to my Win7 32 bit development computer that idea seems less likely. I am beginning to think that this is some kb that our dear friends at Microsoft have pushed out which I religiously install.

I have read every article I can find but they all hark on about iis. Now I know this looks like an iis response and probably is, but what I want to know is (1) why has my laptop started handling the service requests differently and (2) what can I do to get back to where I was? The answer will no doubt help me work out why the service never worked on my fall-back computer also. It is like something is forcing all my get requests into iis, which I definitely don't want to happen.

The app.config file contains a service trace block, which has reliably worked (when not getting this 405 response). Where I have the 405 response, no entries are made in the service trace log.

I would be immensely grateful for the right help. I should stress that my solution is a windows Service, not a web application and my solution has an app.config file NOT a web.config (as would a web application).


Many thanks,

Malcolm

推荐答案

我可以在这个区域内踢自己...



所以所需要的就是包括编程.exe.config文件与prog.exe在同一个文件夹中



感谢那些提供建议的人。



MF
i could kick myself around the block for this one...

so all that is required is to include the prog.exe.config file in the same folder as the prog.exe

Thanks to those who offered advice.

MF


这篇关于WCF GET REQUEST返回405方法不允许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆