简体   繁体   English

使用 IIS7 在 Web 服务器上部署 ASP.NET Webhooks

[英]Deploying ASP.NET Webhooks on web server with IIS7

I have read through a few .NET Webhooks tutorials and since it is relatively new for .NET the examples are pretty limited.我已经阅读了一些 .NET Webhooks 教程,因为它对于 .NET 来说相对较新,所以示例非常有限。 I followed the tutorials to create a Webhook project in VS2013.我按照教程在 VS2013 中创建了一个 Webhook 项目。 When I published the project I got three files (Global.asax. package.config, Web.config) and a bin folder with the dll's.当我发布项目时,我得到了三个文件(Global.asax.package.config、Web.config)和一个包含 dll 的 bin 文件夹。 Here are a couple of the tutorials:以下是一些教程:

https://blogs.msdn.microsoft.com/webdev/2015/09/04/introducing-microsoft-asp-net-webhooks-preview/ https://blogs.msdn.microsoft.com/webdev/2015/09/04/introducing-microsoft-asp-net-webhooks-preview/

http://www.dotnetcurry.com/aspnet/1245/aspnet-webhooks-receive-webhooks-from-github http://www.dotnetcurry.com/aspnet/1245/aspnet-webhooks-receive-webhooks-from-github

All of the tutorial examples I have come across utilize Azure to publish their Webhook.我遇到的所有教程示例都使用 Azure 来发布他们的 Webhook。 We have our own web server with IIS7.我们有自己的带有 IIS7 的 Web 服务器。 I created a folder (appfolder) on our web server, another folder in it called mailchimp and placed the published files and bin folder in that folder so the path would be D:\\appfolder\\mailchimp.我在我们的 Web 服务器上创建了一个文件夹 (appfolder),其中另一个文件夹称为 mailchimp,并将发布的文件和 bin 文件夹放在该文件夹中,因此路径为 D:\\appfolder\\mailchimp。 I then created a new Site in IIS7 named apps.mysite.org pointing to D:\\appfolder.然后我在 IIS7 中创建了一个名为 apps.mysite.org 的新站点,指向 D:\\appfolder。 So as I believe the URI for the webhook should be http://apps.mysite.org/mailchimp/api/webhooks/incoming/mailchimp .因此,我认为 webhook 的 URI 应该是http://apps.mysite.org/mailchimp/api/webhooks/incoming/mailchimp However, when I try to set the Webhook URL in my Mailchimp list it tells me "We couldn't connect to the specified URL.但是,当我尝试在 Mailchimp 列表中设置 Webhook URL 时,它告诉我“我们无法连接到指定的 URL。

What do I need to do to set up my web server to receive .NET Webhooks?我需要做什么来设置我的 Web 服务器以接收 .NET Webhooks? I would assume that the api/webhooks/incoming/mailchimp is a folder path but have not been able to find what I need to place in there.我会假设 api/webhooks/incoming/mailchimp 是一个文件夹路径,但无法找到我需要在其中放置的内容。

Any assistance to go further would be awesome.任何进一步的帮助都会很棒。

The WebHook URI doesn't look right: WebHook URI 看起来不正确:

http://apps.mysite.org/mailchimp/api/webhooks/incoming/mailchimp http://apps.mysite.org/mailchimp/api/webhooks/incoming/mailchimp

It should be of the form它应该是这样的形式

http://apps.mysite.org/api/webhooks/incoming/mailchimp?code=<somesecret > http://apps.mysite.org/api/webhooks/incoming/mailchimp?code=<somesecret >

The <somesecret> is a random value that you set when registering the URI with MailChimp. <somesecret> 是您在向 MailChimp 注册 URI 时设置的随机值。 Also, in practice it should also 'https' and not 'http'.此外,实际上它也应该是“https”而不是“http”。

Hope this helps!希望这可以帮助!

Henrik亨里克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM