2009-05-13 15 views
2

私はIIS7クラシックで実行されているWebフォームアプリケーションを持っています。これは、サイトのクライアント側の重い部分に.asmxスタイルのWebサービスを使用します。Asp.netルーティング、WebServices、およびIIS7の古典

私たちは "フレンドリーなURL"でレイヤーを張り、新しいAsp.netルーティングを使うことに決めました。

<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サービスを:私たちは、web.configファイルで(system.webServer/hanlersを)この宣言を生成するASPNET_ISAPI.DLL、へすべての要求をマップするIISでルールを持っています(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&amp; 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は、Googleを精練している間にこれをやっている誰も見つけられていないので、大混乱を引き起こしているということです。

ありがとうございました。

答えて

3

あなたはすなわち、web.configファイルにハンドラにrequireAccess="None"を追加する必要があります。

<add name="aspnet_isapi 32-bit" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" /> 

これは、ファイルが正しく

を処理することができます
関連する問題