System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

I have written a web service and tested it and it works fine from the .asmx test page.

However, when I attempt to call it with a post I get this error: 

The remote server returned an error: (500) Internal Server Error.

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.Net.WebException: The remote server returned an error: (500) Internal Server Error.

Source Error:

Line 164:            myStream.Close()
Line 165:
Line 166:            Dim SomeResponse As WebResponse = XmlHttp.GetResponse()
Line 167:            Dim strm As Stream = SomeResponse.GetResponseStream()
Line 168:            Dim sr As StreamReader = New StreamReader(strm)


Source File: c:\inetpub\wwwroot\SCNet\App_Code\SCClientSvc.vb    Line: 166

Why does the test work fine but give a 500 error when I just try and get the response?

0
codeaholic
1/15/2007 10:00:40 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

1 Replies
4687 Views

Similar Articles

[PageSpeed] 42

Hi

This is a general error message. 

Pls take a look at the event log on server to view detailed error message.

Make sure the Url you specified in code is correct.


NOTE:If you find my response contains a reference to a third party World Wide Web site, I am providing this information as a convenience to you.Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,Microsoft cannot make any representations regarding the quality,safety, or suitability of any software or information found there.
__________________________________________________

Sincerely,
Young Fang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
-2
Young
1/28/2007 11:37:12 AM
Reply:

Similar Artilces:

Web Service Error : The remote server returned an error: (500) Internal Server Error
Hi i am getting an error when trying a simple web service. if i run both the web service and the client .aspx page on the same server it works fine, But when i put it on a different server it doesnt work at all and gives me this error"System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at HttpUtils.HttpPost(String URI, String Parameters) in e:\Websites\C#\Live\CMS\Trunk\App_Code\siteFunctions\HttpUtils.cs:line 35"UserApi.asmx  [WebMethod] public string HelloName(string name) { return "Hello " + name; }  HttpUtils.cs 1 using System.Net; 2 using System.IO; 3 4 /// &lt;summary&gt; 5 /// Summary description for HttpUtils 6 /// </summary> 7 public class HttpUtils 8 { 9 public static string Errors { get; set; } 10 11 public static string HttpPost(string URI, string Parameters) 12 { 13 Errors = null; 14 WebRequest req = WebRequest.Create(URI); 15 req.ContentType = "application/x-www-form-urlencoded"; 16 req.Method = "POST"; 17 byte[] bytes = System.Text.Encoding.ASCII.GetBytes(Parameters); 18 Stream output = null; 19 try 20 { 21 req.ContentLength = bytes.Length;//Get the Lenght 22 output = req.GetRequestStream();//Get the S...

System.Net.WebException: The remote server returned an error: (500)
I am getting a an error The remote server returned an error: (500) Internal Server Error. 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.Net.WebException: The remote server returned an error: (500) Internal Server Error. Source Error: Line 45: response.write ("Hello I am here First") Line 46: wRequest.Headers.Add("Man", "GET " & URL)...

The remote server returned an error: (500) Internal Server Error
Hi  String strUrl = "http://catalogues.cataloguecentral.com.au/global/search/search.aspx?";              // Create a request using a URL that can receive a post.         WebRequest request = WebRequest.Create(strUrl);        // Set the Method property of the request to POST.        request.Method = "POST";        // Create POST data and convert it to a byte array.        string postData = "query_xml=<?xml version='1.0' encoding='utf-8' ?><search_xml><search before='25' after='25'><![CDATA[jacket]]> ...Blah Blah";      //  postData = postData.Replace((char)39, (char)34);       PostXml(strUrl, postData);     //   postData = postData.Replace("\\\", string.Empty);        //string postData = "?query_xml=" + getXMLString();        //postData = HttpUtility.UrlEncodeToBytes (postData);        byte[] byteArray = Encoding.UTF8.GetBytes(postData); //Encoding.UTF8.GetBytes(postData);        // Set the ContentType propert...

remote server returned an error: (500) Internal Server Error.
Hi Frnds, I have Using HTTP Post Method ,Already create Webconfig fine(  <webServices>      <protocols>        <add name="HttpGet"/>        <add name="HttpPost"/>      </protocols>    </webServices> )But i got  remote server returned an error: (500) Internal Server Error. i am not using SOAP.. public void Post()        {      ...

he remote server returned an error: (500) Internal Server Error.
Hi, I would like to connect a webservice. But I don't want to use "add web reference" -------------------------------------------------------------------------------------------- string strSoapMessage = "<?xml version='1.0' encoding='UTF-8'?>" + "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"+ "<soap:Body>"+ "<GenerateSessionKey xmlns='http://www.artwork-systems.com/webway/sessions'>"+ "<login>test</login>"+ "<auth>test<...

The remote server returned an error: (500) Internal Server Error.
When I remote access in website by application on window to extract data I have error : The remote server returned an error: (500) Internal Server Error. This is my code : Dim PostData As String = _ "__VIEWSTATE=" & tmpvs & _ "&txtUserName=" & UserID & _ "&txtPassword=" & PWord & _ "&chkPersistant=1" & _ "&btnSignIn=SignIn" '& _ Dim Data() As Byte = encoding.GetBytes(PostData) Dim LoginReq As Net.HttpWebRequest = Net.WebRequest.Create(loginURL) With LoginReq .KeepAlive = Fals...

The remote server returned an error: (500) Internal Server Error
I have a VB.Net application where I am posting to an HTTP server that has a classic asp page and I am getting the following exception (it's throwing the exception on line 13).  Does anyone know how to troubleshoot this?  thanks  : <EXCEPTION> The remote server returned an error: (500) Internal Server Error </EXCEPTION> 1                            PostData = "externalID=" ID2 Dim strPath As String = "http://200.000.00.00/userfiles/someclassicasppage.asp" 3 request = CType(WebRequest.Create(strPath), HttpWebRequest) 4 request.ContentType = "application/x-www-form-urlencoded" 5 request.ContentLength = PostData.Length 6 request.Method = "POST" 7 request.AllowAutoRedirect = False 8 9 Dim requestStream As Stream = request.GetRequestStream() 10 Dim postBytes As Byte() = Encoding.ASCII.GetBytes(PostData) 11 requestStream.Write(postBytes, 0, postBytes.Length) 12 requestStream.Close() 13 response = CType(request.GetResponse(), System.Net.HttpWebResponse)    I have ...

The remote server returned an error: (500) Internal Server Error.
 System.Net.WebException: The remote server returned an error: (500) Internal Server Error.     i implemented the search functionality in the website searchdotnet some application i got ,i inegrated it ,it works fine localhost but on server i created some problemMark As Answer If my reply helped you. It means that an exception occured , you can specify in the web.config to show the exact exception to remote hosts.what is the <customErrors> configuration in your web.config ?   J.W.Please click "Mark as Answer" on this post if it helps you...

The remote server returned an error: (500) Internal Server Error #2
Hello, I'm trying to send the request from site A to site B in localhost but get an error "The remote server returned an error: (500) Internal Server Error" in programatically.  The code below used to work for me and all of a certain it fails to send the request to site B (order site). The order site by itself is still up and running but when I try to send the request to this site in the code, it fails because of (500) Internal Server Error.  I also tried to restart the IIS but still doesn't work.  Does anyone knows why?  mReqUrl =...

The remote server returned an error: (500) Internal Server Error. #3
I am trying to access a web site using below snippet HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse webResponse = (HttpWebResponse)httpWebRequest.GetResponse(); This is occuring for particular web site and rest of the web site working fine.  Error:  The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() -532459699...  Also, i tried with below options 1. Adding Credential likeNetworkCredential networkCredential = new NetworkCredential("user name", "pwd", &qu...

The remote server returned an error: (500) Internal Server Error. #2
I am testing a utility program that loops through my localhost and pulls out all of the meta tag information and page titles.   After I do a recursive directory search and have all of the pages i convert the directory path's to urls and call the pages using the following code WebClient wc = new WebClient(uri); string page = wc.DownloadString(uri); This seems to work fine for the first few sites, however at a certain point i start getting (The remote server returned an error: (500) Internal Server Error.).  Nothing is wrong with the URI however it just seems to st...

How to solve:"The remote server returned an error: (500) Internal Server Error. "
 I am working On asp.net2.0(c#) In creating rss i used a user control by writing xml dynamically. It is working well in my personal server but in my client server it is producing error such that.. Server Error in '/GetReception' Application. The remote server returned an error: (500) Internal Server Error. 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.Net.WebException: The remote server returned an error: (500) Internal Server Error.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: [WebException: The remote server returned an error: (500) Internal Server Error.] System.Net.HttpWebRequest.GetResponse() +1529755 System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials) +61 System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +1865280 System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +51 System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +44 System.Threading.CompressedStack.runTryCode(Object userData) +54 System.Runtime.CompilerServices.RuntimeHelpers.Execute...

Message="The remote server returned an error: (500) Internal Server Error."
 HI,when I try to call a simple web method with parameters using HTTP Post I am getting this error "Message="The remote server returned an error: (500) Internal Server Error.""  This My Web Method [WebMethod]        public string getDataWithParm1(string aaa)        {            string ss= "yytry";            ss =ss + " asdfg" ;            r...

System.Net.WebException: The remote server returned an error: (401) Unauthorized.
I have application hosted on server with Basic authentication mode then I try to access the file it give me the following exception The remote server returned an error: (401) Unauthorized. 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.Net.WebException: The remote server returned an error: (401) Unauthorized.Source Error: An unhandled exception was generated during the execution of the current web request. ...

System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Friends I am getting the error System.Net.WebException: The remote server returned an error: (401) Unauthorized.at this line 'Dim resp As HttpWebResponse = req.GetResponse()' in folowing code Dim url As String = "http://localhost" & Request.ServerVariables("URL")Dim req As HttpWebRequest = WebRequest.Create(url)Dim resp As HttpWebResponse = req.GetResponse()Dim sr As New StreamReader(resp.GetResponseStream())Dim result As String = sr.ReadToEnd()sr.Close()   Can any one have idea to resolve this error??   Thanks JSQUARE...

Axis call to .Net web Service internal server error 500
 Hi, Desperately need advise as I'm not able to call a .Net web service. Problem is, the .Net web service works well when it's call via SoapUI. Could it be any .Net configuration being overlooked? Thanks in advance. After performing a network trace.. here are the details.. Call from Axis..POST /WebService/CPServices.asmx?wsdl HTTP/1.1Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_84B12E522B4E0E31C41234969838674; type="application/xop+xml"; start="<0.urn:uuid:84B12E522B4E0E31C41234969838675@apache.org>"; start-info="ap...

System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
Hello, I am using XMLTextReader to read in an xml file from an external website. Randomly I recieve the Subject error. After doing some research and very little understanding on the subject, I added the following chunk of code in attempt to add a webproxy but I still randomly receive the error. Here is the code: System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxy.ilmgroup.com:8080/", true);System.Net.WebRequest req = System.Net.WebRequest.Create(http://www.treas.gov/offices/enforcement/ofac/sdn/sdn.xml);req.Proxy = proxyObject;xtr = new XmlTextReader(http://www.treas.gov/offices/enforcement/ofac/sdn/sdn.xml); As I mentioned, I have very little understanding of this concept. I do realize that the WebProxy is our proxy server but do not really understand what the WebRequest is for, I put in the adreesss of the XML page I wnt to read in.  Can anyone suggest a better way of getting past the "407" error, or possible explain to me what I have done wrong in my above code. Thanks so much for any help! Put your mind first and your body will follow!A ship at port is safe but that is not what the ship was built for!Courage is being afraid but saddling up anyway! You could try adding credentials right after you create the proxy. proxyObject.Credentials = New System.Net.NetworkCredential("domain\username","pass") I'm having similar issues and that fixed some of them. You're proxy may also be setup to not allow the code level calls as they are, ...

Server Error: HTTP Error 500.19
I got the following error while trying to make a test WCF project on VistaServer Error HTTP Error 500.19 - Internal Server ErrorDescription: The requested page cannot be accessed because the related configuration data for the page is invalid. Error Code: 0x80070005 Notification: BeginRequest Module: IIS Web Core Requested URL: http://localhost:80/ProductsService/ProductsService.svc Physical Path: C:\Test\ProductsService\ProductsService\ProductsService.svc Logon User: Not yet determined Logon Method: Not yet determined Handler: Not yet determined Config Error: Cannot read configura...

FCKeditor XML request error: internal server error(500)
Hi all, i'm not sure that this is the right place to post this problem but i did :)i'm tring to use FCKeditor  in my .net application and every yhing is gooing well, but when i try to upload an image or create dir. to the server, the following error apear XML request error: internal server error(500), can any body help please. Hello Please See mySolution in below link http://forums.asp.net/thread/1516166.aspx This occur while you dont access to xml Pages file names and folder names transfer by xml file beetween fckeditor.dll and html pages www.yeknegah.com...

Why does a simple select query in Microsoft Access return the error [Intersolv][ODBC SQL Server Driver][SQL Server]ct_results(): user api layer: internal client library error: Read from the server has
I have applied the information from support document 10447954 but that does not solve the problem. I am running a simple select query with one criteria from one table. Thanks. ...

Why does a simple select query in MS Access return the error: [Intersolv][ODBC SQL Server Driver][SQL Server]ct_results(): user api layer: internal client library error: Read from the server has timed
I have applied the information contained in support document 10447954. That did not resolve the problem. I am running a simple query with one criteria and one table Thanks. Hi Bill, The doc refers to a different ODBC driver (for DirectConnect product) so you might have a completely different problem. The message implies you are using ODBC 12.0 (Client Library based) or prior since the message indicates CtLib info. You might want to post more details involved with getting to this error. You also might want to post exact versions of ASE and ODBC driver, including Open ...

XML Request Error:Internal Server Error(500) when opening CKFinder
Hi All, I'm not sure that if this is the right place to post this issueWe are using ASP.net 2.0. In our application we use FCKEditor Ver is 2.2.2952.27793 and CKFinder 1.0.1.20567. We are using FCKEditor for adding contents(in admin area) in the site and we have a link in the same page, clicking on which the admin could view the files which are uploaded by the registered users of our website. FCKEditor works without any issues. But when we try to open CKFinder.html from the link to view the files which are uploaded by the users, we get the following error XML Request Error:Interna...

Inconsistent 500 Internal Server Error with Web Service
I'm getting an inconsistent and occassional error with my webservice and it comes up with this error:  The remote server returned an error: (500) Internal Server Error. We doesn't happen all the time and seems to go away and come back on its own. Anybody ever seen this before???Its very strange. Hi codeaholic , That is a general error message. It means error happened inside Web Service. On server side open Event View you can get detailed error message that may be helpful to find the exact problem.NOTE:If you find my response contains a reference to a third party World Wide Web ...

Internal server error using System.Net.WebResponse
Hi, Can anyone help me? I'm developping a WebDAV application, and I have written a DAV class which source code follows: ***************************************************************** public class DAV { private WebRequest Wreq; private WebResponse Wres; public DAV(string http) { Wreq = WebRequest.Create(http); Wreq.Credentials = CredentialCache.DefaultCredentials; Wreq.ContentType = "text/xml"; } public void setQuery(string method, string XMLQuery) ...

Web resources about - System.Net.WebException: The remote server returned an error: (500) Internal Server Error. - asp.net.xml-web-services

Resources last updated: 3/10/2016 12:06:40 AM