저는 AJAX 호출에 사용할 수있는 대규모 웹 서비스를 만들고 있습니다. 각 서비스에 [System.Web.Script.Services.ScriptService]
을 추가했습니다. 우리는 IHttpModule.Init 오버라이드에서 로깅 및 국제화를 위해 정기적으로 사용하는 일부 객체를 초기화하는 등록 된 HttpModule을 가지고 있습니다. 모든 웹 메소드에 SOAP 요청을하면 IHttpModule.Init가 호출되지만 웹 메소드에 JSON 요청을하면 그렇지 않습니다. 나는 그것이 불릴 때 파일에 써서 이것을 확인했다..Net 웹 서비스가 자바 스크립트 프록시 (AJAX)를 통해 호출 될 때 HttpModule이 활용됩니까?
.Net 웹 서비스가 자바 스크립트 프록시 (AJAX)를 통해 호출 될 때 HttpModule이 활용됩니까? 그렇다면 어떤 종류의 구성이 부족합니까? 관련 코드 비트는 아래에 포함되어 있습니다.
-colin-
의 Web.config :
<httpModules><add name="GlobalApplicationModule" type="Common.GlobalApplicationModule, Common"/></httpModules>
HTTPModules.cs : 매우 이상한 디버그 로깅 방법입니다
class GlobalApplicationModule : IHttpModule
{
public void Dispose()
{
Internationalization.LanguageProvider.ReleaseAllResources();
}
public void Init(HttpApplication application)
{
// DEBUG: Confirm that this method is called
StreamWriter writer = new StreamWriter("c:\\deleteme-HTTP_module_test.txt");
writer.WriteLine("Init called.");
writer.Close();
// Initialize logger
Common.Logger.Initialize("LogAssemblyPath", "LogClassName");
Common.CentralConfiguration.CreateConfiguration(new Common.CentralizedStrategy());
// Initialize language provider
if (!Internationalization.LanguageProvider.Initialized)
{
try
{
string debug = System.Configuration.ConfigurationManager.AppSettings["debugInternationalization"];
string languageAssemblyLocation = System.Configuration.ConfigurationManager.AppSettings["LanguageAssemblyLocation"];
string languageAssemblyBaseName = System.Configuration.ConfigurationManager.AppSettings["LanguageAssemblyBaseName"];
languageAssemblyLocation = System.Web.HttpContext.Current.Server.MapPath(languageAssemblyLocation);
Internationalization.LanguageProvider.Init(languageAssemblyLocation, languageAssemblyBaseName, false);
if (debug != null && bool.Parse(debug))
{
Internationalization.LanguageProvider.PrefixText = "*";
}
}
catch (Exception x)
{
Common.Logger.Instance.LogError("Could not intialize assembly language provider. Error: " + x.Message);
}
}
}
}
코드의 일부가 코드로 표시되지 않은 것 같습니다. 다시 포맷 해 주실 수 있습니까? – ram
".Net 웹 서비스가 자바 스크립트 프록시를 통해 호출 될 때 HttpModule이 활용됩니까?" - 그렇습니다. 문제는 다른 곳에서 발생합니다. –