The server didn't send back a proper XML response - asp.net

I'm using FCKEditor in that when "Browse Server" button is clicked the following error is thrown.
The server didn't send back a proper
XML response. Please contact your
system administrator.
XML Request error: Not Found(404)
Requested URL:
/fckeditor/editor/filemanager/connectors/asp/connector.asp?Command=....
I'm developing and testing my website on IIS7 with .NET.

I would imagine that you need to ensure that you've configured FCK to use ASPX for the FileBrowserLanguage and QuickUploadLanguage rather than asp.
I've got this set in the CustomFckConfig.js file, rather than modifying the core FckConfig.js file:
// The following value defines which File Browser connector and Quick Upload
// "uploader" to use. It is valid for the default implementaion and it is here
// just to make this configuration file cleaner.
// It is not possible to change this value using an external file or even
// inline when creating the editor instance. In that cases you must set the
// values of LinkBrowserURL, ImageBrowserURL and so on.
// Custom implementations should just ignore it.
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
I can't imagine that IIS7 is configured to serve .asp pages these days - isn't it geared up for .aspx? Seeing as you've tagged this question asp.net, I assume that the rest of your site is running in .Net.

We had same problem with our web site build in .net 3.5 and hosted on IIS7.
I found solution that helped us. We changed source code of fckeditor (small fix) and set response filter property to null. Bug was related to compression of server response in asp.net.
Article that helped us we found HERE.
I hope it will help you too.
Best regards,

Been walking through --a very long walk I might add-- a lot of suggested solutions but never found one that would address my problem.
I kept on getting the same response:
The server didn't send back a proper
XML response. Please contact your
system administrator.
XML request error: OK (200)
Requested URL:
https:.../fckeditor/editor/filemanager/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F&uuid=1260177467559
Response text:
window.location.replace("http:.../fckeditor/editor/filemanager/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F&uuid=1260177467559
Until finally, I stepped closer, re-read the response again and noticed that the request and response are using different protocols.
FYI, the editor is implemented in a secure part of the site accessible by site admins only. We're using the Ventaur component that does the automatic switching of HTTP/HTTPS requests.
The images --we only need to upload/browser image types-- reside in a subdirectory that is also configured to use HTTPS.
This gave me an indication as to where the problem is coming from, so I proceeded to set the fckeditor directory to use HTTPS as well.
This finally worked and iI was able to upload/browse images.

Using FireBug, check what the response the server is sending back to you.
You can do this by checking the Console Tab, after clicking your 'Browse Server' button.
That way, you can see what exactly is being received from the server, so you'll be able to debug it.

That means that either a URI mapping is not made, or a file is missing. It's trying to access a certain URI, but it cannot find it (404 status code).
Are you sure your installation/configuration is complete and correct?

In addition to Zhaph's comment, check the server encoding and make sure that jives with your FCKEditor configuration.

make sure your fckeditor.dll is on the path of Bin folder
and make sure you have a right version of it

Related

Jmeter Performance test on ASP.net form losing session

Hi guys i have a very strange problem. I am tasked to conduct several performance tests on an old Webpage (2004 - something).
The module that is under test is created with ASP.net forms.
Im using Jmeter for the task.
I have used Chrome extention (Blazemeter) to generate the starting script.
But a very strange problem occurs all other pages of the form are fine and dandy... except a page for file upload where upon trying to proceed(Make a POST request) it loses its session and you are redirected to another screen with generic- Would you like to continue last session type of messages appear.
In order to try to debug the problem i wrote a simple Post request on IntelliJ and everything works fine when executed.
I then returned to Jmeter and punched in everything identical to the script and i still get the same problem.
I then decided to try the Jmeter recording proxy ( in case the blazemeter is faulty and assigns some values incorectly) And while i was manualy browsing the form the problem Appears! - when i click on proceed on that specific upload form with the jmeter proxy turned on, it loses session and it shows the "continue last session screen". And i am baffled as to how a simple proxy that records could mess up the sessions. I tried it with a normal proxy (not the Jmeter one) and everything works. So it seems that the problem is in Jmeter or some settings.
Have you guys ever encountered such a problem , or have some insight as to what might cause such behavior. Additional info:
I have worked on ASP.net form before and i am extracting __VIEWSTATE __EVENTARGUMENT and a couple of other hidden variables from the previous response and passing them to the request.
I am using the Multipart/form-data for the upload file module POST and passing the file properly.
As a standart i am using KeepAlive and Follow Redirects but i have tried Redirect Automatically or all of the above switched off.
There is a Cookie Manager set up on Test Plan level and it is working in HC4 - compatibility(tried all others too) based on the requests its working properly.
Cache Manager to 5000 elements.
Certificates seem to be properly imported (for the Jmeter proxy).
I am at this point baffled as to why Jmeter refuses to act properly and i would be very gratefull if someone could help me.
Hi guys il just post an update since i found a work around. So if i record everything with blazemeter (since jmeter proxy doesnt allow me) and after on the upload step i delete the steps and just write a manual request in the body with multipart/form tick turned off and just write the multipart stuff in the headers it seems to work. I still have no idea why it behaves this way.

manifest.json causing 500 errors in ASP .NET application

So I added a manifest.json to the application. I am using it to define various icon settings and mobile settings. I gave it a start url of "/", and I've tested it with a start url of "~", "." and simply leaving the property undefined.
The manifest works locally, but when I build it to a QA server I get error 500s on a bunch of javascript files in the bundle, including the VMs that generate the navigation for the app. I've added the JSON mimeMap to the web.config and have done a fair amount of research but I'm coming up blank. Help!
The ~ works with the ASP.NET rendering engine to render relative URLs. This is really limited to the server. Remember the PWA code is decoupled from your server-side code/server. The browser is only looking at the server via HTTP and is unaware of any server-side logic you may have. It only cares about what is sent to it across the wire.
Analyze your network waterfall and see what URLs are being requested. If the URLs being requested have the ~ in them, you need to change your manifest file, well you should remove that anyway IMO.
Do you know the details of the server side error(s)? Or are you masking that behind the default 5xx message in ASP.NET? It would be helpful to know what the exact error being thrown on the server is to help debug the issue.

500 Internal Server Error IIS7 Encoded url

Im using N2Cms and am looking in to some issues i have with it. It has a navigation panel on the left hand side that loads via ajax as you expand the tree.
The code that gets the childeren of the node calls an ashx file with some parameters. One parameter is for a path and contains slashes in it. For this reason it has been encoded.
.../cms/Content/Navigation/LoadTree.ashx?target=preview&selected=%252fhome%252fhelp-and-advice%252f
I have had no issues with this on my development server (running iis 7.5) but when deployed to our test server (iis7) the navigation fails to work.
Investigating this has shown that the above url gives a 500 error.
If i decode the url to
.../cms/Content/Navigation/LoadTree.ashx?target=preview&selected=/home/help-and-advice/
it works with no problems.
Unfortunately i cannot change the code that generates this as its a part of the n2cms source code and i am assuming it has been encoded for a good reason.
Does anyone know anything i can do either in my web.config to allow encoded parameters or something i can change on the iis server?
EDIT:
So this link seems to suggest that its doing this on purpose as a security mesure.
http://msdn.microsoft.com/en-us/library/ee656542.aspx
The suggested solution is to upgrade to .net 4.0 and add the following to the web.config
<configuration>
<uri>
<schemeSettings>
<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
</schemeSettings>
</uri>
</configuration>
Unfortunately this seems to have no effect.
Any Ideas why this doesnt work?
This could be the URLScan utility. URL Scan blocks URL's based on the rules in it's config file. It also has it's own log file, so you can tell for sure by looking at the URLScan log.
Do a google search for URLSCan default location.
It seems your url goes through 2 html encode.
Is there some url rewriting module active on your IIS7 server ?
OK, im getting somewhere with this.
When trying to find the error in the IIS logs and failing, then looking through many posts about failed tracing request and still not getting any errors in iis, i figured that the request was just not getting to IIS.
Looking back at the server error, there was a clue there too.
500 Internal Server Error. The request was rejected by the HTTP filter.
It is the firewall!!
We have disabled the HTTP Filter and now it works :)
I now need to investigate what this HTTP Filter was supposed to be protecting us against and are we secure now we have switched it off.

Best way to handle a 404 in a file download HTTP handler?

I've got a grid which provides some links for users to download files. Files are stored outside of the application, the path references are read from the database and a HTTP handler (*.ashx) is used to serve each requested file. It is, however, possible that there could be a database entry pointing to a non existent file. I catch the FileNotFoundException, but I'm not sure what would be the best method to inform the user of the missing file (so that they can contact support).
First idea is to set a standard 404 code on the response, and that's what I'm doing now.
A more helpful way would be to display a notification (jQuery) about a missing file, but the file download is not done in AJAX, so this would involve a two step process - a client side onclick handler calls a web service method to check if the file exists, if not, then I cancel the click (return false) and display a friendly message to the user. If the file exists however, I proceed with the normal execution. But this adds yet another server call.
Have you dealt with a similar problem? How did you solve it?
Some clarifications - the application is built in ASP.NET 2.0 and uses jQuery to call the web service methods.
Pawel, it seems you've answered your question already...
...(so that they can contact
support)...
By stating the above I would suggest you create a custom 404 page which notifies the user of the file not existing on disk and provide them information on how to get in contact with the support office.
I've created a HTTP Handler for handling files and if a file does not exist on disk then I return a 404 response. I've setup IIS to display a custom page if a 404 reponse has been thrown.. (and I do the same for error 500).
Hope this helps and good luck with finding the solution that fits your needs!

Why would an aspx file return 404 ("The page cannot be found")

Why when I access an aspx (e.g., http://www.example.com/foo.aspx - not the real site) through IE6 would I get a 404 Error (i.e., "The page cannot be found") in IIS6
I've got scripts enabled for the website and I've tried with executables enabled as well.
Here is the full error:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or
is temporarily unavailable.
------------------------------------------------------------------------------
Please try the following:
Make sure that the Web site address displayed in the address bar of your
browser is spelled and formatted correctly.
If you reached this page by clicking a link, contact the Web site
administrator to alert them that the link is incorrectly formatted.
Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)
------------------------------------------------------------------------------
Technical Information (for support personnel)
Go to Microsoft Product Support Services and perform a title search for the
words HTTP and 404.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for
topics titled Web Site Setup, Common Administrative Tasks, and About Custom
Error Messages.
I can get to Default.htm in the same directory, so I know the path is right. I've opened it up to everyone (temporarily) so I know the permissions are right.
It could be a lot of things. I had this issue today because .NET had not been re-initialized after installing IIS (aspnet_regiis -i -enable or equivalent).
Check that the anonymous user under which the site runs has read access to the file foo.aspx.
IIS6 and later uses a 404 response, thereby not letting an attacker know whether such a file even exists.
I just happened to find another culprit for this issue. My foo.aspx page referenced a particular master page that had a <%# Register %> directive to a user control that did not exist. Removing the reference to the non-existent user control caused my foo.aspx to load instead of 404.
I found a solution here.
The real catch was using this:
Response.TrySkipIisCustomErrors = true;
The site is pointing to a different directory where the page is not.
It could be permissions, however I would think you would get an access error instead.
I'm assuming you are running IIS.
Check that www.example.com is going to the site that you think it is.
If you are hosting multiple sites on the same IP using host headers you may want to double check the name you are using is going to the site you think it is.
Ray and Joe probably have it. In order to serve any file type, IIS has to have a mapping for it. Aspx files require that they be mapped to the AspNet ISAPI dll, which the .Net installation normally takes care of. If you install IIS after .Net (and I'm sure there are other situations), you have to initiate this yourself by running aspnet_regiis.
ALTERNATE SOLUTION (same error perhaps different cause).
I had installed Visual Studio 2008 Pro without SQL Express it, and it caused this same error. Reinstallation of VS2008 with sql express included seemed to have corrected the problem, or perhaps the install took other actions. I did try to register ASP.net numerous times prior but no luck however it is definitely the most probable cause Just posting my experience for those pulling their hair as I was..
Thanks
If you register the .NET 4 version of IIS, you may find it's grabbed the registration of the aspx extension. If ASP.NET v4 is prohibited then 404 will be returned
I had this issue where some customers were reporting the 404.0 and some didn't have the problem at all(same page). I was able to navigate to any of the pages with no problems from my machine. Some customers would refresh and it would go away. I am using .Net 4.5.2 and IIS 7.5.
Looking at the IIS log file I would see:
sc-status sc-substatus sc-win32-status
404 0 2
sc-status.sc-substatus: 404.0 - Not Found
sc-win32-status: 2 - ERROR_FILE_NOT_FOUND
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
https://en.wikipedia.org/wiki/HTTP_404
I found the problem was I had deployed a new version of the website in which the old version of the website had RouteConfig.cs/FriendlyUrlSetting setup by creating a project using the web forms template. The new version was created using an empty template. So obvious to me now.. no URL routing. Customers had a cache issue with certain pages on their machine(no .aspx extension) and having them clear browser data ultimately fixed the problem.
I got this issue when I tried using a different drive to host my apps. I ended up moving them to the wwwroot folder because it was working there and I did not have to time figure out why it is not working on the E:\ drive.
I had bin\roslyn compiler missing. Adding that all worked fine.
Check for double quote errors. I started getting a 404 on a single page because I accidentally had this:
<asp:TemplateField HeaderText="ImageURL"">
instead of this:
<asp:TemplateField HeaderText="ImageURL">
For an aspx page, error 404 can be quite misleading! I have seen all the answers and they presuppose assuming various issues with the file, page, path, etc. but the simplest issues is the fact that if there is an error in your asp page (i.e bad format, improper usage of control, etc. asp will think the page does not exist and will post a 404 when in all actuality, it is easy to ascertain if there is a bad format by simply clicking on design mode. If the page does not render no need to do anything else but look at what is causing the render error, fix and viola'! Your page shows since it was never missing or can't be found, but it simple did not know how to display! Too often people go looking for the wrong solutions and waste so much time! Hope this helps somone. :-)

Resources