我有一个DTS任务,它使用MSXML2.XMLHTTP3.0对象生成一个发送请求到ASP.NET应用程序。在底层,ASP.NET应用程序使用System.Reflection获取一些程序集信息,我收到以下异常:
System.Web.HttpException Error Code: -2147467259 Message Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the section in the application configuration.
DTS工作代码:
Dim objSvHTTP
Dim PostData
Set objSvHTTP = CreateObject("Msxml2.XMLHTTP.3.0")
objSvHTTP.open "POST", "http://www.mywebsite.com", false
objSvHTTP.send
If (objSvrHTTP.responseText = "") Then
//do something
Else
//do somethiing else
End If
ASP.NET应用程序代码:
string WebPath = "D:mywebsiteinmywebsite.dll";
Assembly UI = Assembly.LoadFrom( @WebPath );
Type t = UI.GetType( "MyWebsite.BasePage" );
MethodInfo MyMethod = t.GetMethod( "MyMethod" );
object obj = Activator.CreateInstance(t);
MyMethod.Invoke( obj, null);
问题是,是否需要在XMLHTTP请求中提供有效的Active Directory凭据给ASP.NET应用程序以避免错误消息。