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 property of the WebRequest.
        request.ContentType = "application/x-www-form-urlencoded";
        // Set the ContentLength property of the WebRequest.
        request.ContentLength = byteArray.Length;
        // Get the request stream.
        Stream dataStream = request.GetRequestStream();
        // Write the data to the request stream.
        dataStream.Write(byteArray, 0, byteArray.Length);
        // Close the Stream object.
        dataStream.Close();
        // Get the response.
        WebResponse response = request.GetResponse(); // Getting Error Here
        // Display the status.
        Console.WriteLine(((HttpWebResponse)response).StatusDescription);
        // Get the stream containing content returned by the server.
        dataStream = response.GetResponseStream();
        // Open the stream using a StreamReader for easy access.
        StreamReader reader = new StreamReader(dataStream);
        // Read the content.
        string responseFromServer = reader.ReadToEnd();
        // Display the content.
        Console.WriteLine(responseFromServer);
        // Clean up the streams.
        reader.Close();
        dataStream.Close();
        response.Close();

 

  Above code was breaking at  WebResponse response = request.GetResponse(); 

( I have tried by pasting http://catalogues.cataloguecentral.com.au/global/search/search.aspx?query_xml=<?xml version='1.0' encoding='utf-8' ?><search_xml><search before='25' after='25'><![CDATA[jacket]]> ...Blah Blah" in Internet explorer and Firefox, It's returning an xml file so no problems with security I have given full rights to this directory)

  Any Idea why it's breaking

 

Thanks

 

 

 

 

0
sharathv2
4/17/2009 12:44:48 AM
asp.net.handlers-modules 2116 articles. 0 followers. Follow

4 Replies
3825 Views

Similar Articles

[PageSpeed] 17

If you can not debug a server method on search.aspx - just set customErrors element in web.config to Off - server will return an error's full description.


May the Force be with you
0
nKognito
4/17/2009 4:33:47 AM

 Thanks for your Reply

    As I mentioned before my code was breaking at   // Get the response.
        WebResponse response = request.GetResponse(); // Getting Error Here

 we are using third parties search.aspx, The old classic ASP pages are using similar method and working fine. In .net I am getting this error

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

I can't see what is search.aspx because that is out of my scope, I have to pass querystring as xml (search string) and it will returns xml (search result) When I test by copy paste on the browser it works fine i don't why above code was breaking

Any help 

 

0
sharathv2
4/19/2009 11:01:07 PM

Hi,

From your description, it seems that you met error while requesting that url in your asp.net code, right?

If so, i think you need to check your application step by step, and try to check the exact url your application is requesting.

Thanks.


Michael Jin.
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Nai
4/20/2009 2:10:12 PM

 Thanks for your reply

   I have tried the same string (url) in my code, still i am getting the same error. Any help

 

Thanks

0
sharathv2
5/5/2009 4:23:25 AM
Reply:

Similar Artilces:

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? 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 ...

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...

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()        {      ...

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.
 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...

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. #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...

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...

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 return...

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...

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...

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 ...

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)...

Internal Server Error (Error 500)
Hello We are using BM 3.8.4 and Netware 6.5 sp5. We are a school, and after rolling out a new student information system, the Bordermanager proxy is (almost daily now), reporting an Internal Server Error (Error 500) that locks the teachers out of the system. We have had this problem sporadically in the past, but it is almost daily now that I have to restart the Bordermanager server. I am planning today to use the proxy.cfg file as posted from Craig Johnson, mainly to change the lines of PassContentLength=1, IgnoreContentLength=1, and IgnoreContenetLengthCheck=1 as those seem to...

Error 500 Internal Server Error
I have recently upgraded from Netware 5.0 to Netware 6.5. I was running Groupwise 6.5 on Netware 5.0 and had a problem with webaccess not sending messages. After running into reinstallation problems with directory services because I was on netware 5, I upgraded to 5.1 and then to 6.5 netware. Everything is loading and working fine now except that when I click "Go" on the webaccess page I get a Server Error 500 instead of the login page. I have tried several things from various TIDs with no luck inlcuding reinstallations of webaccess and the web server. I've also...

Error:- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Hi I am using asp.net-2.0 with aspnetAjax and SQL-server2000. I have two pages. On first page- there is a gridview with hyperlink for every record. after clicking on the hyperlink the second page shows. with the details of that record. Both  pages have UpdatePanel. On second page when I click on any server control (asp:button), there is a message box displayed (Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500) This message box is occurring only on pa...

error by IIS after create Virtual directory: HTTP Error 500.0
 I have error by IIS after create Virtual directory: HTTP Error 500.0 - Internal Server ErrorI see it after I call project name of virtual directory, like: http://localhost/myprojectI have vista and visual studio 2008.. any help?  Server Error in Application "Default Web Site" HTTP Error 500.0 - Internal Server Error Description: This application is running in an application pool that uses the Integrated ..NET mode. This is the preferred mode for running ASP.NET applications on the current and future version of IIS.In this mode, the application should not specify ASP.NET handler mappings in the <system.web>/<httpHandlers> configuration section. Instead, it should use the <system.webServer>/<handlers> configuration section to configure ASP.NET handler mappings. You have the following options:1) Migrate the application to work with the Integrated .NET mode (PREFERRED). You can migrate the application configuration, including the contents of the <httpHandlers> configuration section, by using the following from a command line window (the window must be running as Administrator): %systemroot%\system32\inetsrv\APPCMD.EXE migrate config "Default Web Site/" After you migrate your application, it will run in both Classic and Integrated .NET modes, as well as on downlevel platforms.2) Move this application to an application pool using the Classic .NET mode.You can move the application to an appli...

IdHTTP error : 500 Internal Server error
I am trying to get data from server using IDHttp.Get, but I get error 500, and I don't know why. The data I send is the same as the data FireFox sends. You can check WiresShark data from Indy and Firefox: http://failiem.lv/down.php?i=qpgwinl&n=WireShark.rar Hello Pauls, > I am trying to get data from server using IDHttp.Get, but I get error > 500, and I don't know why. 500 generally means the server encountered an error on its side. That usually, but not necessarily, means that you sent bad request data that the server could not handle. > The data I send ...

getting error like
hello  Using Ajax 1.0 RC I’m getting this error:Sys.WebForms.PageRequestManagerServerErrorException Error: an unknown error occurred while processing the request on the server. the status code return from the server was 403I have one update panel in which i have gridview control. i have sorting true in gridviewwhen i click on header for sorting and wait for the result. it display updateprogress and working fine as expected.but if i click for sorting on header continueously without stoping after 10 or 12 click it gives me above error. I am struckup heremy code is like this:<asp:Update...

The remote server returned an error: (401) Unauthorized error
Hi,   I have a website (abc.com) on server A that is trying to get a XML file from a link on def.com. This is the code I have :HttpWebRequest wreq; HttpWebResponse wres;wreq= (HttpWebRequest)WebRequest.Create(url); wreq.Method = "GET";NetworkCredential nc= new NetworkCredential(uid, pwd); wreq.Credentials = nc;wres= (HttpWebResponse)wreq.GetResponse(); StreamReader sr= new StreamReader(wreq.GetResponseStream());   When I hit the URL from the browser on a.com, it prompts me with a login screen and with the correct credentials it displays the XML file. But when...

The remote server returned an error: (503) Server Unavailable
Hi I'm not sure if this is the right place to post this...The thing is that I'm trying to fetch a Xml file from a url coz I don't want to save it everytime a post is made. string uri = @"http://www.whatever.com/myxmlfile"; //this returns an xml file!XmlReaderSettings xs = new XmlReaderSettings();XmlReader x = XmlReader.Create(uri, xs); But when I do this, it gives me the following error: The remote server returned an error: (503) Server Unavailable. I would appreciate any help. ThxAndré da Silva Carrilhohttp://andrecarrilho.blogspot.com/http://dotnetslackers.com/community/blogs/andrecar...

Web resources about - The remote server returned an error: (500) Internal Server Error - asp.net.handlers-modules

Energy returned on energy invested - Wikipedia, the free encyclopedia
The natural or original sources of energy are not usually included in the calculation of energy invested, only the human-applied sources. For ...

How Facebook Returned A/B Testing To Mobile Apps
When Facebook rewrote its mobile applications and converted them from custom Web stacks to native development stacks, it lost the ability to ...

Facebook temporarily reveals ‘returned value’ metric for ads
Some Facebook advertisers temporarily saw a new metric called “returned value” in their Ads Manager dashboard. Facebook says the metric was accidentally ...

Baby sloth, rescued from captivity and to be returned to the wild - Flickr - Photo Sharing!
Paradise Garden, Boquete, Panama See where this picture was taken. [?]

Batista reveals why he returned to WWE - YouTube
The Animal talks about overcoming a broken back, his immersion in Jiu-Jitsu training, and his desire to capture the WWE World Heavyweight Championship. ...

Nearly 600 vehicles impounded by UAE authorities returned
The vehicles were returned last month after the impoundment period ended and all associated fines were paid.

Bender is back! Belair’s favourite robot returned - AdelaideNow Search Search
GOOD news, everyone! Bender the robot — possibly the coolest letterbox in the Adelaide Hills — has been returned just days after being stolen. ...

Thousand Mile Stare at ANCA: Katy Mutton explores trauma of returned Anzacs
The Australian Capital National Artists Inc is commemorating the Anzac centenary with an exhibition about postwar trauma.

First word: Deposit returned
We did the sums: giddy amounts of money, compared with our pocket money, or the occasional penny for an ice-block.

Young families have returned to the property market this year - DailyTelegraph Search Search
YOUNG families are back buying houses on the northern beaches after a year where they mostly stayed away.

Resources last updated: 2/19/2016 9:15:43 AM