C# IIS重定向/重写.asmx服务

C# IIS重定向/重写.asmx服务,c#,asp.net,web-services,iis,asmx,C#,Asp.net,Web Services,Iis,Asmx,我已经到处寻找这个问题的答案,但找不到任何符合我具体情况的答案 目前已设置以下各项: RootApplication(sitea.bla).NET 3.5 -ChildApplication(sitea.bla/service1.NET 3.5 根应用程序正在.NET 4.5中重写,但service1应用程序在当前阶段不会更新,将作为子应用程序删除 我已将service1应用程序移动到子域(service1.sitea.bla),以便它可以在旧版应用程序池中运行 尽管我有多个引用原始端点的其他应

我已经到处寻找这个问题的答案,但找不到任何符合我具体情况的答案

目前已设置以下各项:

RootApplication(sitea.bla).NET 3.5

-ChildApplication(sitea.bla/service1.NET 3.5

根应用程序正在.NET 4.5中重写,但service1应用程序在当前阶段不会更新,将作为子应用程序删除

我已将service1应用程序移动到子域(service1.sitea.bla),以便它可以在旧版应用程序池中运行

尽管我有多个引用原始端点的其他应用程序/服务/客户机,但这种方法工作得非常好。我已经设置了一个IIS重定向,它可以在浏览器中完美地工作

sitea.bla/service1/exampleservice.asmx被重定向到service1.sitea.bla/exampleservice.asmx

不过,当通过客户端应用程序进行调用时,除非我手动将端点更改为新的子域,否则调用将失败。我还尝试通过反向代理实现


在不手动将所有端点更改为新子域的情况下,实现此目的的最佳方法是什么?

您需要设置正确的重写规则:

<rule name="rewrite service1" stopProcessing="true">
    <match url="^service1(.*)" />
    <action type="Rewrite" url="http://service1.sitea.bla{R:1}" />
</rule>
1) 您需要安装(您需要它,因为您正在将请求重写到不同的应用程序)

2) 在IIS管理器中,应启用反向代理

2.1)在服务器节点上单击“应用程序请求路由缓存”

2.2)单击“服务器代理设置”并单击“启用代理”,然后单击“应用”

3) 在应用程序的web.configsitea.bla中添加此重写规则:

<rule name="rewrite service1" stopProcessing="true">
    <match url="^service1(.*)" />
    <action type="Rewrite" url="http://service1.sitea.bla{R:1}" />
</rule>


4) 尝试调用sitea.bla/service1/exampleservice.asmx

您需要设置正确的重写规则:

<rule name="rewrite service1" stopProcessing="true">
    <match url="^service1(.*)" />
    <action type="Rewrite" url="http://service1.sitea.bla{R:1}" />
</rule>
1) 您需要安装(您需要它,因为您正在将请求重写到不同的应用程序)

2) 在IIS管理器中,应启用反向代理

2.1)在服务器节点上单击“应用程序请求路由缓存”

2.2)单击“服务器代理设置”并单击“启用代理”,然后单击“应用”

3) 在应用程序的web.configsitea.bla中添加此重写规则:

<rule name="rewrite service1" stopProcessing="true">
    <match url="^service1(.*)" />
    <action type="Rewrite" url="http://service1.sitea.bla{R:1}" />
</rule>

4) 尝试调用sitea.bla/service1/exampleservice.asmx