XML Creation at the server

Hi there!

I´ve created an ASP page with exactly the content below:

--------------------------------------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<%
text="<note>"
text=text & "<to>Tove</to>"
text=text & "<from>Jani</from>"
text=text & "<heading>Reminder</heading>"
text=text & "<body>Don't forget me this weekend!</body>"
text=text & "</note>"

set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async=false
xmlDoc.loadXML(text)

xmlDoc.Save("test.xml")
%>

</body>
</html>
--------------------------------------------------------------------------

I have uploaded this "XML_test.asp" to the remote server and tried to run the page with my browser.

It did NOT create the test.xml document (I got a "500 Internal Server Error" page.)

What should I do to make it work, please?

Thanks!
fskilnikAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Franck GaspozSoftware Architect, Technical ExpertCommented:
Hi, please can you provide these informations :
What is the version of IIS do you use ?
Do you have any stack strace of the error displayed in the browser page (or else does error showing is turned on in IIS settings ?)
thanks you in advance for the answers
zc2Commented:
I guess, the script fails because it does not have permissions to save the file.
Since you did not specify the exact output file path, it is being saved not to the folder where your .asp is located but to C:\Windows\SysWOW64\inetsrv\ directory (if you run it in 32bit mode) or to C:\Windows\System32\inetsrv (for 64 bit mode). Those are system directories and usually an application does not have a writing access.
Try to obtain the asp file location physical path and prepend it to the output file name.
fskilnikAuthor Commented:
Hi, Franck.

Thank you for your support.

>> What is the version of IIS do you use ?

Internet Information Services
Microsoft Corporation
Version: 5.1

>> Do you have any stack strace of the error displayed in the browser page (or else does error showing is turned on in IIS settings ?)

---------------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
----------------

My computing skills are very limited... but I could not find any server error log on the server (it is a dedicated server at godaddy, if that helps).
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

fskilnikAuthor Commented:
Hi zc2, thank you too.

>> Try to obtain the asp file location physical path and prepend it to the output file name.

I will in the next minutes!!
fskilnikAuthor Commented:
zc2 :

I´ve changed just the last line to:

xmlDoc.Save("www.mywebsite.net/test.xml")  

The asp file is (also) at the root of the site directory.

I´ve got the same error message, and the xml file was not created...
Franck GaspozSoftware Architect, Technical ExpertCommented:
To do the zc2 test, you have to put the physical path of the folder containing your asp file:
for instance, c:\WWWroot\mysite\test.xml assuming that your asp file is located in this folder.
zc2Commented:
No, that won't work. You need to specify a physical directory.

Try this:
xmlDoc.Save( Server.MapPath("/") & "\test.xml" )

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fskilnikAuthor Commented:
Hi there!

Franck:   >> c:\WWWroot\mysite\test.xml

I don´t know if I understood your point...

This (below), for instance, works when my fileName.asp file is at the root of the site...

<!--#include virtual="fileName.asp"-->

That´s why I thought I should put xmlDoc.Save (www.mysite.net/test.xml)  as tried before...  

I´ve also tried xmlDoc.Save (www.mysite.net/httpdocs/test.xml)

Because I can see a certain "httpdocs" folder when using filezilla... it did not work either.

zc2  >> Try this:
xmlDoc.Save( Server.MapPath("/") & "\test.xml" )

It did not work.
Franck GaspozSoftware Architect, Technical ExpertCommented:
check for any log file in a folder like :
C:\Windows\Sytem32\Logfiles\W3svc1
fskilnikAuthor Commented:
I´ve put  Response.write(Server.MapPath("/"))  "to work" and got this:

C:\Inetpub\vhosts\mysite.net\httpdocs

Then I´ve tried:

xmlDoc.Save(C:\Inetpub\vhosts\mysite.net\httpdocs\test.xml)

And it did not work either...
fskilnikAuthor Commented:
Hi Franck,

I found the W3SVC10 folder inside the logs folder in the root directory.. the files there are the following:

u_extend1.log  , size 398.826.111  , date today, 11h47min
web_stat_executor.conf  , size 452 , date today, 09h4min
ftp20150618120448888.log , size 92 , date today, 09h04min
web20150618120029848.log , size 1.982.558 , date today, 09h

Should I download and try to open any one of them, please?
Franck GaspozSoftware Architect, Technical ExpertCommented:
open any recent log file (with a modified date matching your last test date) and watch at the end of the files if you can find any detailled error message;  try to watch also in any folder inside or beside the mentionned folder.
zc2Commented:
Then I´ve tried:
xmlDoc.Save(C:\Inetpub\vhosts\mysite.net\httpdocs\test.xml)
Did you forget quoutes, should be
xmlDoc.Save("C:\Inetpub\vhosts\mysite.net\httpdocs\test.xml")
fskilnikAuthor Commented:
Hi, Franck.

Thank you very much!

I´ve tried to download the first (above) file, but Filezilla says "critical error in the transference of the file" (badly translated from portuguese)... I will try to contact the chat support at godaddy and get from them the error log.

As soon as I get it, I will post it here, okay?!

Thanks a lot and please wait for my next post!
fskilnik.
fskilnikAuthor Commented:
Hi zc2,

>> xmlDoc.Save("C:\Inetpub\vhosts\mysite.net\httpdocs\test.xml")

You are right, I had NOT put the quotes, but now I did and... unfortunately it did not work either...
Franck GaspozSoftware Architect, Technical ExpertCommented:
You're welcome. I will have a look at godaddy IIS debugging settings possibilites, it may help
zc2Commented:
There are chances the writing access to that directory is also forbidden.
You could try either give a writing permission to the folder or find a folder on the filesystem which let IIS process to write.
Also you could try to change the application pool's credentials to the ones of your account.

Do you need instructions how to check or/and change folder permissions and app pool credentials?
fskilnikAuthor Commented:
Thank you both!

I am still with the chat support at godaddy.  They will let me download de error log files that may be related to the issue.

zc2 : thank you for your initiative... it may be necessary, yes. "Grant" (at godaddy) said that permissions on the "XMLCreation_test.asp" file are okay, though... he is looking at my server at this very moment...
fskilnikAuthor Commented:
Hi there!

"Grant" gave me access to the log error from the server. The txt file was huge, but I attached here just the final part of it related to today´s last activities.

I guess all the info you need is contained there.

Good luck and thank you very much for this support!!
fskilnik.

P.S.: I will be out-of-office in the next approx. 1.5h  .... as soon as I´m back, I will come here!
fskilnikAuthor Commented:
Ops... forgot to upload the file... sorry!
LogError.txt
fskilnikAuthor Commented:
Hi Franck and zc2... any ideas (perhaps related to the error-log file), please ?
fskilnikAuthor Commented:
Franck and zc2:

I went again to godaddy´s chat and another guy opened a ticket on the matter (after checking what seems to be a well-configurated server).

As soon as I receive their comments, I will come back to share with both of you information they provide.

Thanks a lot for now. Please wait my new post (I hope tomorrow)!

Regards,
fskilnik.
zc2Commented:
The log file you send contains only HTTP requests, there are no site internal errors.
Try to browse the windows log.
Also you could try the Sysinternals' ProcMon utility.
Start it monitoring the w3wp.exe process, then try to access your page.
Stop capture and search for your file name. Analyze the writing event, make note which user account was in use.
Go to the destination folder and grand the writing permissions to that user.
zc2Commented:
On the other thought, I might be wrong that your issue is with the denied file write (or at least not only that). I tried to execute your asp, but changed the save call with an invalid path and I was not getting the server error 500, I got the following message instead:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
But as I understand, the asp itself actually works, since you were able to get the output from Response.write(Server.MapPath("/"))

Try to comment out the asp lines one by one to find out on which line the error start occurring.
Franck GaspozSoftware Architect, Technical ExpertCommented:
Hi, zc2 is right. In my mind, the necessary step from now is to activate an error logging in IIS. In order to do that, we must know much more about your godaddy server. do you have access to IIS settings (IIS manager app in windows) ? else, maybe we can do something with your web.config file. You must activate asp full error traces in web page in order to find a solution to such problems.
fskilnikAuthor Commented:
Hello, Franck and zc2.

Sorry for the delay to come back here!

Thanks A LOT for all your inputs.

zc2 (ID: 40838174):  I don´t have enough skills to go through your instructions without a step-by-step orientation (I have never heard even about the names of files/processes/utilities you mention!) ... that´s why I guess it is better to wait for the answer to the ticket opened at godaddy. (Perhaps they are evaluating things similar to what you suggest!)

zc2 and Franck:

>> Try to comment out the asp lines one by one to find out on which line the error start occuring
>>  to activate an error logging in IIS.

Excellent!  I guess this is something that we should do even before I receive an answer from godaddy (and I may be able to do that with good chances of success, without bothering you A LOT...)

> do you have access to IIS settings (IIS manager app in windows) ?

Yes!  Please tell me what I should do at that place!   :)

>  we can do something with your web.config file.
>  You must activate asp full error traces in web page in order to find a solution to such problems.

I don´t have a web.config file at the server at this moment (well, I could not find it) but in the past I had one with only the following in it:

--------------------------------
<configuration>
   <system.webServer>
   <customErrors mode="Off" />
   </system.webServer>
</configuration>
--------------------------------

Should I simply turn the mode to "On" and upload this file to the server we are dealing with?  In the affirmative case, where should I put this file, in the root?

Thanks A LOT, really.

Regards,
fskilnik.
fskilnikAuthor Commented:
Hi there, Franck and zc2 !!

I guess you both are very busy today... no problem!

Still working on the questions I´ve left for you, I did find two (I guess) good things:

(i) A (perhaps) nice webconfig file (here at EE) that I will try at my server:

--------------------------------------------------------------
<?xml version="1.0"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>
-----------------------------------------------------

(ii) A (perhaps) nice article about handling errors in ASP language:

http://www.codeguru.com/csharp/.net/net_general/debugginganderrorhandling/article.php/c19677/Web-Application-Error-Handling-and-Logging-For-ASP.htm

Just to finish this post, let me mention that I entered into a new chat with godaddy´s support and they told me there is a specific person trying to understand "what is going on"...

As soon as I have news, I will come back here. This Sunday I will come back anyway, to see if you have something else to add, also about the webconfig and the article I intend to try to implement.

Regards and have a great day/weekend!
fskilnik.
fskilnikAuthor Commented:
Hi there!

Although I have not received any news from the people at Godaddy yet, I guess they solved the server configuration problem "internally", because now it is working as expected and the XML file was created successfully (exactly when I was trying to put the web.config file to work and to show me errors, LoL...)

As far as points are concerned, I hope I was fair:

zc2 got the "best" and many points because my initial code did not work, but EXACTLY his suggestion did.

Franck got the "assistance" and good points because I guess his research on the godaddy´s configurations would probably be similar to the one the people inside Godaddy must have done (well, something like that)!  

Before-Last thing:  I really must learn about appearing error messages in ASP (normally I see NONE but when I do run the code locally), therefore I will try to read the link I have found - and put above - in the near future. IF you have other(s), perhaps better link(s) to suggest, of course I will gladly accept it/them!

Last thing: THANK YOU BOTH A LOT, really.  It is ALWAYS marvellous to count on people like you in this extraordinary forum.

Cheers and all the best!
Fabio.

P.S.: I realized the <asp scriptErrorSentToBrowser="true"/> line at the web.config file above must be taken out, by the way ...
Franck GaspozSoftware Architect, Technical ExpertCommented:
Thanks'a lot !
I still advice to enable errors tracing to ensure you to have the necessary help from the server when developping.
I try to have a look to IIS Manager 5.1 (it's an old version, so documentation is hard to find). If i get concrete a accurate informations about this i will post here.
BR,
Franck gaspoz
fskilnikAuthor Commented:
Hello, Franck!

Thank YOU!!

>> enable errors tracing

Sure... I suffer a lot from my poor knowledge on computing AND also from the non-existent error messages from the server.

>> if i get concrete a accurate informations about this i will post here

Excellent. Thanks in advance!!

Kind Regards,
fskilnik.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.