如何从本地托管的网站发回响应,也是一个winform webapplication [英] How do I send a response back from a localy hosted web site too a winform webapplication

查看:82
本文介绍了如何从本地托管的网站发回响应,也是一个winform webapplication的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您花时间阅读我的问题。



我创建了一个响应来自paypal的IPN请求的MVC网站,效果很好。

我决定我需要为网站制作一些mod,并希望创建一个基于Windows窗体的Web应用程序来模拟paypals IPN机制。



我可以连接到我本地托管的MVC网站,并使用我的winform应用程序中的HttpWebRequest发送到IPN消息,因为我知道URL。但是,在我的MVC网站内,我需要将响应发送回调用的winform应用程序。我悲惨地失败了:(



我从MVC网站获得了主机地址:: 1,我相信它相当于127.0.0.1本地主机。



我试图创建一个webrequest所有的地址,但也无济于事。



我得到'遥控器服务器返回错误:(405)方法不允许'我用Google搜索此消息,但在此字段中的经验有限,无法解决问题。我检查了IIS处理程序映射,但是全部都是平方的。



任何帮助/示例代码都会非常棒!



非常感谢提前。

解决方案

不允许HTTP 405方法只是意味着您尝试使用的任何HTTP动词,如GET / POST等,服务器不允许这样做。要获取详细信息,请使用fiddler查看HTTP请求/响应并进一步排除故障

Hi, thanks for taking the time to read my question.

I have created a MVC web site that responds to IPN requests from paypal, It works well.
I decided I need to make some mods to the site and wanted to create a windows Forms based web application to simulate paypals IPN mechanics.

I can connect to my locally hosted MVC web site and send to IPN message to it using the HttpWebRequest from my winform application as I know the URL. However, inside my MVC Web site I then need to send a response back to the calling winform app. I'm failing miserably :(

I got the host address ::1 from within the MVC web site which I believe equates too 127.0.0.1 local host.

I tried to create a webrequest too all the addresses but too no avail.

I get 'The remote server returned an error: (405) Method Not Allowed' I googled this message but have limited experience in this field and couldnt resolve the issue. I checked IIS handler mappings but went all squared eyed.

Any help/example code would be marvellous!

Many thanks in advance.

解决方案

HTTP 405 method not allowed simply means whatever HTTP verb you are trying to use like GET/POST etc, the server doesn't allow to do it. To get the details use fiddler to see the HTTP request/response and troubleshoot further.


这篇关于如何从本地托管的网站发回响应,也是一个winform webapplication的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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