Delphi本机Web服务应用程序无法正常工作。 IIS 7似乎正在剥离pathinfo [英] Delphi native Web Service applications not working. IIS 7 seems to be stripping the pathinfo

查看:122
本文介绍了Delphi本机Web服务应用程序无法正常工作。 IIS 7似乎正在剥离pathinfo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个我从未在XP或IIS 6中遇到的有趣问题。



基本上,我无法获得原生的Delphi(WebBroker)Web服务服务器在Windows 7 64位中使用本机Web服务客户端。



这是最基本的细分。如果我在Delphi 2010(或任何版本,返回Delphi 7)中创建一个新的Web服务应用程序,并使用IE 8访问它,我可以看到WSDLHTMLPublish组件创建的HTML,但我永远无法访问SOAP。同样,WSDL Importer也无法访问SOAP。 (我将IIS 7配置为使用32位应用程序池,并且我已经为Handler Mappings创建了一个工作脚本映射。简而言之,32位ISAPI Web服务正在运行。)



例如,我有一个名为TestService的简单Web服务服务器(使用创建新Web服务服务器时生成的默认样本接口创建)。



<我将它安装在一个名为scripts的虚拟目录中。



如果我输入 http://localhost/scripts/TestService.dll/wsdl ,IIS 7显示页面 http://localhost/scripts/TestService.dll



如果我将鼠标悬停在ITestService的WSDL链接上,我会看到 http://localhost/scripts/TestService.dll/wsdl/ITestService 。但是,当我单击此链接时,地址栏显示 http://localhost/scripts/TestService.dll / wsdl / ITestService ,但我只看到来自 http://localhost/scripts/TestService.dll的HTML 。似乎无法进入SOAP定义。 IIS 7似乎忽略了脚本名称之后的所有内容(它忽略了pathinfo)。



IIS7剥离pathinfo的其他证据是,如果我暂停鼠标通过ITestService链接,状态栏显示 http://localhost/scripts/TestService.dll?intf = ITestService 。单击该链接将我带到另一个HTML页面,该页面与 http:// localhost / scripts / TestService相关联.dll文件?INTF = ITestService 。但是,任何包含脚本名称后面的pathinfo的链接,我只需要 http:// localhost / scripts / TestService。 dll



我在Delphi 7,Delphi 2010和Delphi XE中对此进行了测试,结果相同。



我猜测IIS7正在剥离pathinfo,因为即使WSDL Importer也无法访问SOAP定义。



尝试创建新的Web服务使用CGI选项,并得到相同的结果。



知道发生了什么吗?



已添加:鲍勃斯沃特报告称他在Windows 7 32位下没有遇到任何问题。下载32位操作系统并尝试(在新的VM中)。

解决方案

问题是我创建了一个ISAPI dll的处理映射中的特定脚本映射。这导致IIS将所有请求重定向到特定的dll,这就是为什么忽略包含信息路径部分的任何请求的原因。信息路径被剥离。



我真正需要做的是简单地启用ISAPI-dll模块映射处理程序映射的执行功能权限。一旦允许未指定的ISAPI模块(或CGI模块,如果这是您创建的Web服务器扩展类型),此模块映射可用于虚拟目录。



为了解决我的问题,我需要


  1. 删除我搞砸了处理映射的目录。


  2. 由于我已经允许未指定的ISAPI模块(从服务器的IIS部分选择ISAPI和CGI限制小程序中的编辑功能设置),然后我需要添加一个新的虚拟目录对于相应的网站(这里我重新创建了我在上一步中删除的目录。


  3. 从虚拟目录的Handling Mappings小程序中,你可能已禁用ISAPI-dll处理映射。选择它并选择右侧的编辑功能权限选项。启用执行复选框。


不要编辑ISAPI-dll处理映射并添加一个可执行文件。即使这个对话框显示Executable是可选的,一旦你添加了一个,它就结束了。你永远不能删除它(我永远不会删除它)。在我的一个VM安装上,我在此对话框中有一个可执行条目。为了摆脱它,我不得不卸载IIS 7,然后重新安装它。 (也许这不是必需的,但我无法弄清楚如何在不输入Executable条目的情况下删除并重新安装模块映射。)



此外,如果您的ISAPI DLL是一个32位DLL,并且您在64位操作系统中工作,您需要为关联的应用程序池启用32位应用程序。



I希望我的痛苦帮助了某人。


I've run into an interesting problem that I never encountered with XP or IIS 6.

Basically, I can't get a native Delphi (WebBroker) Web service server to work with a native Web service client in Windows 7 64-bit.

Here's the most basic breakdown. If I create a new Web service application in Delphi 2010 (or any version, back to Delphi 7), and access it using IE 8, I can see the HTML that the WSDLHTMLPublish component creates, but I can never get to the SOAP. In the same way, the WSDL Importer cannot get to the SOAP either. (I have IIS 7 configured to use a 32-bit application pool, and I have created a working Script Map to the Handler Mappings. In short, the 32-bit ISAPI Web service is running).

For example, I have a simple Web service server named TestService (created using the default sample interface generated when you create a new Web service server).

I installed it in a virtual directory named scripts.

If I enter http://localhost/scripts/TestService.dll/wsdl, IIS 7 displays the page http://localhost/scripts/TestService.dll.

If I put my mouse over the WSDL link for the ITestService, I see http://localhost/scripts/TestService.dll/wsdl/ITestService in the status bar. However, when I click this link, the address bar shows http://localhost/scripts/TestService.dll/wsdl/ITestService, but I see only the HTML from http://localhost/scripts/TestService.dll. There seems no way to get to the SOAP definition. IIS 7 seems to be ignoring everything after the script name (it is ignoring the pathinfo).

Additional evidence that IIS7 is stripping off the pathinfo is that if I pause my mouse over the ITestService link, the statusbar shows http://localhost/scripts/TestService.dll?intf=ITestService. Clicking that link takes me to another HTML page, the one associated with http://localhost/scripts/TestService.dll?intf=ITestService. However, any link that includes a pathinfo following the script name, takes me simply to http://localhost/scripts/TestService.dll.

I have tested this in Delphi 7, Delphi 2010, and Delphi XE, with the same results.

I am guessing that IIS7 is stripping off the pathinfo, since even the WSDL Importer cannot get to the SOAP definition.

Tried creating a new Web service using the CGI option, and got the same result.

Have any idea what is going on?

Added: Bob Swart reports he has had no problems under Windows 7 32-bit. Downloading the 32-bit OS and will try that (in a new VM).

解决方案

The problem was that I had created a specific script mapping in the Handling Mappings for the ISAPI dll. This caused IIS to redirect all requests to the specific dll, which was why any request that included an info path part was ignored. The info path was stripped off.

What I really needed to do is to simply enable the Execute feature permission of the ISAPI-dll module mapping handler mapping. This module mapping is available for a virtual directory once you have allowed unspecified ISAPI modules (or CGI modules, if that is the kind of Web server extension you have created).

To fix my problem, I needed to

  1. Delete the directory whose handling mappings I has messed up.

  2. Since I already had allowed unspecified ISAPI modules (select Edit Feature Settings from the ISAPI and CGI Restrictions applet from the IIS section of the server), I then needed to add a new virtual directory for the appropriate Web site (here is where I recreated the directory that I deleted in previous step 1.

  3. From the Handling Mappings applet for the virtual directory, you probably have the ISAPI-dll handling mapping disabled. Select it and select the Edit Feature Permissions option on the right-hand side. Enable the Execute checkbox.

Don't edit the ISAPI-dll handling mapping and add an Executable. Even though this dialog box says that Executable is optional, once you've added one, it's over. You can never remove it (I could never remove it). On one of my VM installs I had an Executable entry on this dialog box. In order to get rid of it, I had to uninstall IIS 7 and then reinstall it. (Maybe this wasn't necessary, but I could not figure out how to remove and reinstall a module mapping without entering the Executable entry).

Additionally, if your ISAPI DLL is a 32-bit DLL, and you're working in a 64-bit operating system, you need to enable 32-bit applications for the associated application pool.

I hope my pain has helped someone.

这篇关于Delphi本机Web服务应用程序无法正常工作。 IIS 7似乎正在剥离pathinfo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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