WCAT & TinyGet testing using HttpHandlers - httphandler

I've searched on Google for an answer to this but there doesn't seem to be much information out there. Does anyone know if you can use WCAT and or TinyGet to test an asp.net application that uses HttpHandlers? I've tried both of these tools and I'm getting an Internal Server Error 500. Looks like a problem with the HttpContext?
[NullReferenceException: Object reference not set to an instance of an object.]
BCT.BaseHttpHandler.Process(HttpContextBase context) +622
BCT.UADTimeHttpHandler.Process(HttpContextBase context) +55
BCT.BaseHttpHandler.ProcessRequest(HttpContext context) +75
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep
.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& comp
letedSynchronously) +75
I've also tried using the WCAT Fiddler plugin but that has a different error about a possible missing reg key.

Definitely you can. WCAT just makes HTTP requests, exactly like any browser. You've got a bug in your handler, is all. What does the code that the stack trace points to say, here:
BCT.BaseHttpHandler.Process(HttpContextBase context) +622
?

Related

Sitefinity upgrade to 10.l2 lost access to blogposts

I am currently trying to upgrade an 8.0 Sitefinity environment to 10.2.6602. This is my first time. The process worked smoothly for the most part but unfortunately as the title suggests I lost access to the blogposts section from the backend and am welcomed with the following when trying to access it:
gERROR - Error: System.Web.HttpException (0x80004005): You are not authorized to access this page
at Telerik.Sitefinity.Web.SitefinityRoute.CheckSecurity(HttpContextBase httpContext, PageSiteNode node)
at Telerik.Sitefinity.Web.SitefinityRoute.GetRouteData(HttpContextBase httpContext)
at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)
at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context)
at System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
There was no specific issue in the upgrade trace log and I already checked the following:
- the blogs are still present in the database.
- the module seems to be succesfully installed.
- I can access the physical posts from the site.
All I can think off is an issue in one of the config files, if anyone has any advice it would be really helpful as I am at a bit of a loss as to what to try next. Could it be a membership issue?
Thank you for any input you might have.
Regards,
Al.

Creating Files in Sitefinity API for docs that already exist on Filesystem

I am working with Sitefinity as a solution in Visual Studio 2012. I'm on a 64bit machine. I just installed Windows Identity Manager as I was getting another error before that and it was related to not having that installed. Now I am receiving this error:
Found invalid data while decoding.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.InvalidDataException: Found invalid data while decoding.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidDataException: Found invalid data while decoding.]
System.IO.Compression.Inflater.DecodeDynamicBlockHeader() +6621162
System.IO.Compression.Inflater.Decode() +408
System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length) +150
System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) +64
Microsoft.IdentityModel.Web.DeflateCookieTransform.Decode(Byte[] encoded) +396
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) +217
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) +1958
Telerik.Sitefinity.Security.Claims.SitefinitySessionTokenHandler.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) +44
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(Byte[] token, SecurityTokenResolver tokenResolver) +149
Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule.ReadToken(Byte[] sessionCookie) +520
Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule.TryReadFromCookie(SessionSecurityToken& sessionToken) +111
Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +95
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
I also followed the advice before and after this post and it did not work for me:
http://www.sitefinity.com/developer-network/knowledge-base/getting-type-is-not-resolved-for-member-microsoft-identitymodel-claims-claimsprincipal-exception
which is what led me to installing the Microsoft identity Manager. I'm not sure how to get past this issue.
There are bugs in Microsoft's DeflateStream implementation prior to .Net 4.5.
See here:
.NET [4 and previous] users should not use the Microsoft-provided
GZipStream or DeflateStream classes under any circumstances, unless
Microsoft replaces them completely with something that works.
This bug was never fixed by Microsoft for earlier versions of the .NET framework than 4.5
As for the difference between Firefox and IE - they might be interacting differently with IIS while using gzip compression, Fiddler might be able to tell you more about the differences in your situation if you look at the raw HTTP requests and responses. Check if the request sequence looks the same between browsers. My gut feeling is that Firefox is falling back to no compression and IE isn't, but without a test bed I won't be able to help further.
You could try these three solutions in increasing order of desperation:
See if you can change the app pool in IIS for the SiteFinity application and your .NET framework target inside Visual Studio to target .NET 4.5 where their GZIP DeflateStream method was fixed.
Attempt to disable GZIP compression in IIS for this application. Follow the instructions found here in reverse. I would try this last because there will be a bandwidth penalty for your server and all users, affecting the user experience.
Install the DotNetZip Library, and override Microsoft's implementation of System.IO.Compression.DeflateStream to call a compatible method that doesn't have the same bug.

ACS azure for published application

Hy guys ,
I developed a WebForms application using VS 2012 . I've published it on Azure .
After that I integrated ACS ( i've set the URL to my allready published application)
I published the application again , but it doesn't work .
After I've registered myself (for ex using Yahoo or LiveID) I've got this error :
Server Error in '/' Application.
The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.]
System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope) +379
System.IdentityModel.ProtectedDataCookieTransform.Encode(Byte[] value) +52
[InvalidOperationException: ID1074: A CryptographicException occurred when attempting to encrypt the cookie using the ProtectedData API (see inner exception for details). If you are using IIS 7.5, this could be due to the loadUserProfile setting on the Application Pool being set to false. ]
System.IdentityModel.ProtectedDataCookieTransform.Encode(Byte[] value) +167
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) +57
System.IdentityModel.Tokens.SessionSecurityTokenHandler.WriteToken(XmlWriter writer, SecurityToken token) +658
System.IdentityModel.Tokens.SessionSecurityTokenHandler.WriteToken(SessionSecurityToken sessionToken) +86
System.IdentityModel.Services.SessionAuthenticationModule.WriteSessionTokenToCookie(SessionSecurityToken sessionToken) +144
System.IdentityModel.Services.SessionAuthenticationModule.AuthenticateSessionSecurityToken(SessionSecurityToken sessionToken, Boolean writeCookie) +82
System.IdentityModel.Services.WSFederationAuthenticationModule.SetPrincipalAndWriteSessionToken(SessionSecurityToken sessionToken, Boolean isSession) +216
System.IdentityModel.Services.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequestBase request) +860
System.IdentityModel.Services.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args) +369
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
What should i do ?
I've set the URL's correctly. I don't have in web.config any reffernces of "localhost"..
I don't know what I must set additionly for this to work..
By default WIF uses DPAPI to encrypt cookies. Switch to cert based encryption. See this answer:
Is it possible to run WIF without LoadUserProfile = True
Vittorio Bertocci answers the question here
http://www.cloudidentity.com/blog/2013/01/28/running-wif-based-apps-in-windows-azure-web-sites-4/
DPAPI is not available in the cloud web apps and 4.5 has a simple solutions

Crystal Reports works via HTTP but not via HTTPS

I have searched every where (I think) and I have not been able to find the answer, maybe because it is so elementary but here goes. I recently deployed a Silverlight Business Application to the Windows Azure platform. I am using Crystal Reports for my reporting and everything was working fine. I need to run the app in SSL, so I purchased a certificate and followed the instructions to get the app up and running and again everything works great except for the reports. When I access the site with via http I have no problems printing my reports. But via https I get the following when I attempt print a report:
Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
Description:
An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details:
System.Runtime.InteropServices.COMException: Unsupported Operation. A
document processed by the JRC engine cannot be opened in the C++
stack.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x80041811): Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +147
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +422
[CrystalReportsException: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +549
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1613
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +189
COCOBOLO.Web.Files.ReportHandler1.MeetingMinutes() +247
COCOBOLO.Web.Files.ReportHandler1.Page_Load(Object sender, EventArgs e) +2392
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
I am almost certain that there is a permission issue using Crystal Reports with SSL but I have no idea what to do. Has anyone had this problem? HELP PLEASE!
since your stack trace shows that Load Report Failed, the first thing i would do is to check whether you have the report in your project and your code is able to access the report.
i know everything works fine using HTTP. Also, make sure that you have read write permissions on the folder where you store your reports.
the problem is not in your crystal report. the problem because ssl don't want to load pdf file.
Display pdf in iframe using ssl/https based
you can try to download pdf viewer in chrome store it's work in ssl and for me.
best regard.

SignalR 500 errors during "ping" on Azure website

I've got an ASP.NET 4.5 web app using SignalR 1.0.0-rc1 which I've pushed out to an Azure website for some quick-and-dirty testing (I'm mostly interested in this page here: http://alantaappbeta.azurewebsites.net/api/v3.0/Tests/Sample.htm).
The problem is that the page doesn't seem to want to talk to the SignalR service. The hubs and everything are registered correctly, as http://alantaappbeta.azurewebsites.net/signalr/hubs returns the correct client-side hubs file, and the call to /signalr/negotiate returns some reasonable looking JSON.
{
"Url":"/signalr",
"ConnectionId":"a15023f9-c675-4fc2-9fd6-403a297f10c0",
"KeepAlive":15.0,
"DisconnectTimeout":40.0,
"TryWebSockets":false,
"WebSocketServerUrl":null,
"ProtocolVersion":"1.1"
}
But when it calls /signalr/ping, it returns a 500 error, with the message "Protocol error: Unknown transport". The stack trace returned in the error page looks like this:
[InvalidOperationException]: Protocol error: Unknown transport.
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequestAsync(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequestAsync(HostContext context)
at Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment)
at Microsoft.AspNet.SignalR.Owin.Handlers.HubDispatcherHandler.Invoke(IDictionary`2 environment)
at Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute()
at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object extraData)
at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Because this is on Azure, I don't have access to all the troubleshooting tools you'd normally have, but what logs I have been able to get access to don't give me any information beyond the above.
I suppose it goes without saying that this runs fine on my local IIS instance :-).
Any suggestions?
Edit: This is how I'm opening my connection:
$.connection.hub.start({
transport: 'auto',
xdomain: true
}).done(function () {
console.log('Connected with hub.id=' + $.connection.hub.id);
}).fail(function (e) {
console.log('Unable to connect to SignalR Hubs: ' + e);
});
But neither the .done() nor the .fail() handlers are being called.
Oddly enough, if I set the transport to 'longPolling', I can get it to fail in a similar manner using IIS Express on my local box. But it doesn't seem to make any difference what I set the transport to on Azure: I still get the same error.
It turns out that the issue was that I had a mix of different versions of SignalR on my machine: I was using the server-side DLLs from the NuGet package (1.0.0-rc1), but the JavaScript client file was from the dev branch. Once I got them all synchronized, everything worked. I'm still not sure precisely why the issue only showed up with Azure, but I suspect it has something to do with the precise transports supported by the different versions of IIS.

Resources