HTTP 500 Error

C

Chris Fink

I am receiving an HTTP status 500 error with the validateXMLFragment
webservice below. I have no way of finding out what specifically is
happening since the debug point in the catch is never being hit. Any
recommendations on where to look?

[WebMethod]

public string validateXMLFragment(string fragment)

{

//return "test";

try

{

bool _isValid = true;

string errorMsg = string.Empty;

XMLValidator xmlVal = new XMLValidator(fragment);

if (!xmlVal.Validate())

{

_isValid = false;

ArrayList errors = xmlVal.Errors;

errorMsg = errors[0].ToString();

}

}

catch (Exception ex)

{

Context.Response.Write(ex.Message.ToString());

}

//string xmlResponse = @"<?xml version='1.0'?><xmlvalidationrequest><xml>" +
fragment + "</xml><status>" + _isValid.ToString() +
"</status><errormessage>" + errorMsg +
"<errormessage></xmlvalidationrequest>";

//return xmlResponse;

return "abc";

}

[WebMethod]

public string Test (string msg)

{

return msg;

}
 
C

Chris Fink

After further debugging, it appears as though the problem is with the call
to the library component.

XMLValidator xmlVal = new XMLValidator(fragment);

Odd thing is, that the break point is never hit, even if placed before the
call. The catch statement is never called either. Very odd.

Do I need to configure permissions in the webservice to make a call to a
custom assembly? Currently the assembly is under wwwroot in a folder called
library with copy local = false (still fails when = true). The webservice is
running under wwwroot in a folder called webservices.

If I could only find out more info on the 500 error I would know where to
look....
 
C

Chris Fink

I answered my question. Copy local needs to be set to True otherwise the
assembly needs to be installed in GAC if copylocal=false.

Chris Fink said:
After further debugging, it appears as though the problem is with the call
to the library component.

XMLValidator xmlVal = new XMLValidator(fragment);

Odd thing is, that the break point is never hit, even if placed before the
call. The catch statement is never called either. Very odd.

Do I need to configure permissions in the webservice to make a call to a
custom assembly? Currently the assembly is under wwwroot in a folder called
library with copy local = false (still fails when = true). The webservice is
running under wwwroot in a folder called webservices.

If I could only find out more info on the 500 error I would know where to
look....


Chris Fink said:
I am receiving an HTTP status 500 error with the validateXMLFragment
webservice below. I have no way of finding out what specifically is
happening since the debug point in the catch is never being hit. Any
recommendations on where to look?

[WebMethod]

public string validateXMLFragment(string fragment)

{

//return "test";

try

{

bool _isValid = true;

string errorMsg = string.Empty;

XMLValidator xmlVal = new XMLValidator(fragment);

if (!xmlVal.Validate())

{

_isValid = false;

ArrayList errors = xmlVal.Errors;

errorMsg = errors[0].ToString();

}

}

catch (Exception ex)

{

Context.Response.Write(ex.Message.ToString());

}

//string xmlResponse = @"<?xml
version='1.0'?> said:
+
fragment + "</xml><status>" + _isValid.ToString() +
"</status><errormessage>" + errorMsg +
"<errormessage></xmlvalidationrequest>";

//return xmlResponse;

return "abc";

}

[WebMethod]

public string Test (string msg)

{

return msg;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top