如何prevent跨域问题通过代理在IIS?问题、prevent、IIS

2023-09-06 09:42:51 作者:朝夕盼兮

我在Delphi编写的一个网站,需要从.NET Web服务获取数据。为了使用Web服务,我连接到​​一个.NET网站首先包含最终用户填写,而这又是那么调用Web服务,才能填充AJAX下拉列表和向导数据返回给调用德尔福Web应用程序。

I have a site written in Delphi that needs to get data from a .NET web service. In order to consume the web service I am attaching to a .NET web site first that contains a wizard that the end user has to fill out, which in turn is then calling the web service in order to populate AJAX drop-down lists and to return data to the calling Delphi web application.

所以,要明确......

So, to be clear ...

在德尔福网站打开.NET网站 在.NET网站AJAX填充下拉从.NET Web服务列表 当用户点击提交关于.NET Web向导它调用.NET Web服务来获取数据并返回到德尔福网站

不过调用.NET Web服务来填充下拉菜单会导致IE6(实际上所有的浏览器)将之视作一个跨域安全威胁,我也得到了此页访问信息,是不是它的控制之下。这会带来安全风险......错误。

However calling the .NET web service to populate the drop downs causes IE6 (and indeed all browsers) to treat this as a cross domain security threat and I get the "This page is accessing information that is not under its control. This poses a security risk ..." error.

在$ C $下的下拉列表如下(在此情况下帮助)...

The code for the drop downs is as follows (in case this helps) ...

在.apsx文件

<asp:DropDownList ID="DocCategoryDropDown" 
              runat="server" 
              OnSelectedIndexChanged="DocCategoryDropDown_SelectedIndexChanged"
              AutoPostBack="true">
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="DocCategoryCascadingDropDown" 
                           runat="server" 
                           TargetControlID="DocCategoryDropDown"
                           LoadingText="[Loading...]" 
                           Category="CategoryId" 
                           UseContextKey="True" 
                           ContextKey="NY"
                           PromptText="Select a Category" 
                           ServiceMethod="GetDocCategory" 
                           ServicePath="tba">
</ajaxToolkit:CascadingDropDown>

在C#文件

DocCategoryCascadingDropDown.ServicePath = path;

如果路径是因为该网站能正常工作,但如果路径是不是我得到了警告,在同一台服务器上,因此它必须是一个跨域安全问题。

If path is on the same server as the web site it works fine but if path is not I get the warning, therefore it must be a cross domain security issue.

我以前曾与Java Web服务类似的问题,我得到围绕这以使承载向导和Web服务的出现存在于同一个域中的网站使用代理上的Apache,并因此而停止中的错误。

I've had similar issues with Java web services before and I got around this by using proxying on Apache in order to make the web site that hosts the wizard and the web service appear to exist on the same domain, and therefore stop the errors.

谁能告诉我怎么可以这样做同样的事情在IIS,请?

Can anyone tell me how I can do this same thing in IIS, please?

如果有更多的信息,我可以提供,请让我知道,因为我真的很想得到这个问题尽快解决,我可以。

If there is any more information I can supply, please let me know as I'd really like to get this issue resolved as soon as I can.

在预先感谢。

推荐答案

确定,经过多次使用Google(切齿)我发现这个网站,很好地解释了解决方案的一个很好的工作。

OK, after much googling (and gnashing of teeth) I found this website that does a good job of explaining the solution.

http://dotnetslackers.com/columns/ajax/MashitUpwithASPNETAJAX.aspx

只是表明它是多么重要的是知道如何提出的的右键的的问题:)

Just goes to show how important it is to know how to ask the right question :)

 
精彩推荐
图片推荐