gpt4 book ai didi

delphi - 在使用 IIS7 的 Delphi CGI 上无法看到 WSDL

转载 作者:行者123 更新时间:2023-12-03 15:49:17 24 4
gpt4 key购买 nike

我创建了一个非常简单的 Delphi 2010 CGI Web 服务,并且能够在 Delphi 2007 上遇到完全相同的问题。

我的可调用界面如下所示:

ISimpleTest = interface(IInvokable)
['{4E318A9A-D361-4A18-A963-EE6D7F70E9C5}']
function SayHello(const S: string; N: Integer): string; stdcall;
end;

该函数以类似简单的方式实现:

function TSimpleTest.SayHello(const S: string; N: Integer): string;
begin
Result := 'Hello ' + S + ', all ' + IntToStr(N) + ' of you';
end;

我将生成的 SimplecGI.exe 复制到运行 IIS7 的 Windows Server 2008 服务器。我创建了虚拟文件夹,配置了执行权限,允许未指定的 CGI 模块,启用了 32 位应用程序,然后最终能够使用如下 URL 从我的浏览器查看服务信息页面:http://myserver:8001/SimpleCGI/SimpleCGI.exe

配置步骤与 IIS6 不同,但两个 IIS 版本上的服务信息页面看起来相同。它还具有 ISimpleTest 的 WSDL 链接,就像在 IIS6 上一样。但在 IIS6 上,单击此链接(类似于这样的 URL: http://myserver/SimpleCGI/SimpleCGI.exe/wsdl/ISimpleTest )会在浏览器中显示预期的 WSDL。但在 IIS7 中,单击同一链接只会再次显示服务信息页面。 IWSDLPublish 的 WSDL 链接和 WSIL 链接 ( http://myserver:8001/SimpleCGI/SimpleCGI.exe/inspection.wsil ) 也是如此。

有人见过这个吗?以前有人解决过吗?

最佳答案

好的,在这里找到答案:http://forums.iis.net/p/1100323/1745984.aspx

IIS7 上的默认安全设置从 CGI 应用程序的 URL 中删除路径信息。要规避它(并允许 Web 服务正常工作),请将以下内容添加到可执行文件所在文件夹中的 web.config 文件中:

<configuration>
<system.webServer>
<handlers>
<add name="ScriptMap1" path="SimpleCGI.exe" verb="*" modules="CgiModule" scriptProcessor="E:\Mypath\SimpleCGI.exe" resourceType="File" allowPathInfo="true" />
</handlers>
</system.webServer>
</configuration>

关于delphi - 在使用 IIS7 的 Delphi CGI 上无法看到 WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1593556/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com