IIS7 Classic で Web フォーム アプリを実行しています。サイトのクライアント側の重い部分に .asmx スタイルの Web サービスを利用します。
私たちは「わかりやすい URL」の階層化を任されており、新しい Asp.net ルーティングを使用することにしました。IIS には、すべての要求を aspnet_isapi.dll にマップするルールがあり、web.config (system.webServer/hanlers) で次の宣言が生成されます。
<add name="asp.net routing" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
しかし、現在、ルーティングによって .asmx Web サービス リクエスト ( http://example.com/blah.asmx/SomeMethodの形式) が壊れています。Web サービスへのリクエストは常に楽しいものです。
Failed to Execute URL.
[HttpException (0x80004005): Failed to Execute URL.]
System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.BeginExecuteUrl(String url, String method, String childHeaders, Boolean sendHeaders, Boolean addUserIndo, IntPtr token, String name, String authType, Byte[] entity, AsyncCallback cb, Object state) +2004885
System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state) +393
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +223
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8677954
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
この行をルート設定に入れます。
routes.Add(new Route("{service}.asmx/{*pathInfo}", new StopRoutingHandler()));
「URL の実行に失敗しました」という例外がまだ残っています。これにより、ルートが一致していることがわかります。
public sealed class DieHandler : IRouteHandler
{
#region IRouteHandler Members
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
throw new NotImplementedException();
}
#endregion
}
routes.Add(new Route("{service}.asmx/{*pathInfo}", new DieHandler()));
「URLの実行に失敗しました」の代わりにそのルートを配置すると、予想どおり「メソッドが実装されていません」と表示されます。
私の疑いは、私たちの * -> aspnet_isapi.dll が大混乱を引き起こしているということです。
事前の洞察に感謝します。