Hi Ethan,
Thanks for getting back to me.
My Local WmsServer already has an override for ProcessRequestCore as shown below. The override provides logging of the requests. By setting a breakpoint in this event I know the TIME field is present as shown in my previous post. After logging is complete base.ProcessRequestCore is invoked so that processing may continue, which results in the SendingWebRequest event being fired.
In SendingWebRequest the TIME field has been removed and is nowhere to be found in the arguments passed to the event. Therefore, it cannot be added to the WebRequest because the value is no longer known and there is no way to know what that value was.
Remember that the ProcessRequestCore and SendingWebRequest are two separate events with no way to pass data from one to the other besides the actual original formatted request string. Remember too that the Local WmsServer is merely a pass through and has no knowledge of the original client request except through the request string.
The solution, I believe, is to do a complete override of ProcessRequestCore, add the TIME field, and remove the call to base.ProcessRequestCore. The request string that ultimately ends up at SendingWebRequest should then have the TIME field.
Would you provide the code required to completely override ProcessRequestCore? I assume this code will have the build of the standard request string and any other necessary code to ensure that SendingWebRequest is fired. I’m not asking for any code other than what is now within ProcessRequestCore.
Thanks,
Dennis
OriStar Mapping, Inc.
protected override void ProcessRequestCore(HttpContext TheContext)
{
Boolean bOutCome;
string TheLogMessage;
string TheLogMessageSub;
string TheIpAddress;
string TheRequestType;
string TheRequestTypeUpCase;
NameValueCollection TheRequestQuery;
OriStarToolsWms.clsWmsClient TheWmsClient;
OriStarLogging.UtlLog4Net.LoggingLevel TheLoggingLevel;
// initializations
TheIpAddress = string.Empty;
TheLogMessageSub = string.Empty;
// get Client IpAddress
TheIpAddress = TheContext.Request.UserHostAddress;
// get Client RequestType
TheRequestQuery = TheContext.Request.QueryString;
TheRequestType = TheRequestQuery["REQUEST"];
TheRequestTypeUpCase = TheRequestQuery["REQUEST"].ToUpperInvariant();
// instantiate Client Object and add/update collection
TheWmsClient = new OriStarToolsWms.clsWmsClient();
TheWmsClient.IpAddress = TheIpAddress;
TheWmsClient.MethodName = "ProcessRequestCore";
bOutCome = OriStarWmsServer.TheAssetsStatic.aTheWmsAssetsShared.WmsClientCollection.Add(ref TheWmsClient);
if (TheRequestTypeUpCase.Equals("GETCAPABILITIES", StringComparison.OrdinalIgnoreCase))
{
TheLoggingLevel = OriStarLogging.UtlLog4Net.LoggingLevel.Fine;
}
else
{
TheLoggingLevel = OriStarLogging.UtlLog4Net.LoggingLevel.Finer;
}
// log condition (even though the Logger checks if Level being Logged, don't even invoke method unless Level is Enabled)
if (OriStarWmsServer.TheAssetsStatic.aTheUtlLog4Net.LoggingLevelsState[(int)TheLoggingLevel] == true)
{
TheLogMessage = string.Format("IpAddress={0}, HostName={1}, HttpMethod={2}, RequestType={3}", TheWmsClient.IpAddress, TheWmsClient.HostName, TheContext.Request.HttpMethod, TheRequestType);
OriStarWmsServer.TheAssetsStatic.aTheUtlLog4Net.UtlLog4NetLogInfo(OriStarWmsServer.TheAssetsStatic.gsAppAssemblyName, TheLoggerClassNameValue, "ProcessRequestCore", ref TheLogMessage, TheLoggingLevel, (OriStarLogging.UtlLog4Net.LoggingDestination.Historical));
}
base.ProcessRequestCore(TheContext);
return;
}