.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Remote server returned an error: (400) bad request

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :Sql Server
 
Hi, I am using IIS 6.0. I have a server, in which i have a web application, which was in http. The report manager(SSRS 2005) was also in http. I moved the web application to https. After moving, i am not able to access the report manager, but i am able to access the web application. I am getting the error as "The remote server returned an error: (400) Bad Request.". How to open the report manager. Thank you


View Complete Post


More Related Resource Links

The remote server returned an unexpected response: (400) Bad Request ERROR

  
Hello I have windows application that proccess and reply to user SMS. I use a web service to send and recieve SMS.I have no access to sever and service setting and only add its reference in my application via "add Service Reference". When i call test method i get following error: "The remote server returned an unexpected response: (400) Bad Request" public void TestMethod() { OutputMessage newMessage = new OutputMessage("YYYYYYY", "XXXXXXX", MessagePriority.Medium); for (int i = 0; i < 10; i++) { ThreadStart starter = delegate() { AnotherTestMethod(newMessage); }; Thread newthread = new Thread(starter); newthread.Start(); } } private void AnotherTestMethod(OutputMessage messageToSend) { smsSoapClient _client = new smsSoapClient(); _client.Open(); string resultOfdoSendSMSCall = _client.doSendSMS("dpardazesh", "dpardazesh", "XXXXXXXX", "XXXXXXXXX", "SMS Text", true); Regex expression = new Regex("Send OK."); if (expression.IsMatch(resultOfdoSendSMSCall)) { resultOfdoSendSMSCall = resultOfdoSendSMSCall.Replace("Send OK.", string.Empty).Trim(); XDocument XmlDocument = XDocument.Parse(resultOfdoSendSMSCall); var AllMessages = from message in XmlDocument.Elements("

The remote server returned an unexpected response: (400) Bad Request ERROR

  
Hello I have windows application that proccess and reply to user SMS. I use a web service to send and recieve SMS.I have no access to sever and service setting and only add its reference in my application via "add Service Reference". When i call test method i get following error: "The remote server returned an unexpected response: (400) Bad Request" public void TestMethod() { OutputMessage newMessage = new OutputMessage("YYYYYYY", "XXXXXXX", MessagePriority.Medium); for (int i = 0; i < 10; i++) { ThreadStart starter = delegate() { AnotherTestMethod(newMessage); }; Thread newthread = new Thread(starter); newthread.Start(); } } private void AnotherTestMethod(OutputMessage messageToSend) { smsSoapClient _client = new smsSoapClient(); _client.Open(); string resultOfdoSendSMSCall = _client.doSendSMS("dpardazesh", "dpardazesh", "XXXXXXXX", "XXXXXXXXX", "SMS Text", true); } Only 2 SMS send by service. I maxReceivedMessageSize  in my app.config file but get same error again. Can anyone help me?

Error rendering "*************" web part: [The remote server returned an error: (400) Bad Request.]

  
Hi There I am implementing a WCF based solution and all was working fine until I started to process larger quantities of data. The Solution worked well in DEV where we added large quantities of daata when we restored the site to QA we got this error . Error rendering Councillors Online web part: [The remote server returned an error: (400) Bad Request.] Can anyone propose a solution to this problem? Thank you My WCF web.config looks as follows : ======================================================== <system.serviceModel>  <bindings>   <webHttpBinding>   </webHttpBinding>  </bindings>  <behaviors>   <serviceBehaviors>    <behavior name="serviceBehavior" >     <serviceMetadata httpGetEnabled="true" />    </behavior>   </serviceBehaviors>   <endpointBehaviors>    <behavior name="web">     <webHttp/>    </behavior>   </endpointBehaviors>  </behaviors>  <services>   <service name="CouncillorsOnline.Service.CouncilMasterDataService" behaviorConfiguration=

WCF HTTP POST - The remote server returned an error: (400) Bad Request. - URGENT

  
client & sever code below-------------------------------------------- [ServiceContract(Namespace = "http://test.mydomain.com")] public interface IMyService{[WebInvoke(UriTemplate = "", BodyStyle = WebMessageBodyStyle.Bare, Method = "POST")] Stream SaveXML(Stream input); } ----------------------[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(Namespace = "http://test.mydomain.com")] public class MyService : IMyService{  public Stream SaveXML(Stream input)   {              StreamReader streamReader = new StreamReader(input);       string rawString = streamReader.ReadToEnd();       streamReader.Dispose();        // here need to save the input stream to xml format file          //       Encoding encoding = Encoding.GetEncoding("ISO-8859-1");       WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";         byte[] returnBytes = encoding.GetBytes(rawString);       return new MemoryStream(returnBytes);   } } --------------------------------------------------Client Code         string postData = GetXmlString("d:\\text.xml"); // user function        WebRequest request = WebRequest.Create("http://test.mydomain.com/myservice.svc");        request.Method = "POST";        byte[] byteArray = Encoding.UTF8.GetBytes(p

The remote server returned an error: (401) Unauthorized. Failed to execute web request for the speci

  

Hi,

I am creating reports using SQL business intelligence 2008.

Connection string 'http://<SharepointServer>/_vti_bin/lists.asmx '.

And i have created a data set using the below xml query.

<Query>
   <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems </SoapAction>
   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/ " Name="GetListItems">
      <Parameters>
         <Parameter Name="listName">
            <DefaultValue>{GUID of the list}</DefaultValue>      
         </Parameter>      
      </Parameters>
   </Method>
   <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>

 

When I try to execute th

The remote server returned an error: (405) Method Not Allowed.

  

Error:

{System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.
   at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
   at System.Net.WebClient.UploadFile(Uri address, String fileName)
   at System.Net.WebClient.UploadFile(String address, String fileName)
   at Test.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\WebSite1\Test.aspx.cs:line 35}

Windows application, automated process will run on local user system...
trying to upload a file to website folder. website address: http://1.1.1.1/test/files

System.Net.WebClient wc = new WebClient();
wc.UploadFile(website address, "c:/1.pdf");

Getting error from above line.. Am doing something wrong??
I dont want to use ftp or share folder logic..
is there any other way to upload the files to server??


[SSRS 2008 R2]Report Builder Access error-The remote server returned an error: (401) Unauthorized.

  
Hello,        I am able to login Web Service URL and report manager using computer name and report builder is also working fine.  http://RPTSRV/reportserver   (RPTSRV is report server name. web service url working fine. all accessible) http://RPTSRV/reports  (report manager working fine and all accessible ,report builder too) It means I am able to access everything locally right? http://rs.test.abc.com/reportserver  (web service url working fine. all accessible)  http://rs.test.abc.com/reports    (Report manager working fine and all accessible accept report builder)(I carefully checked the link and its taking rs.test.abc.com/reportserver.....)     when I click on reportbuilder button in report manager it shows me error dialog box with following error log!! I tried from local and remote computer too but gives the same error both side. I am not sure but I am just thinking is this double hop kerberos security issue? Please help me to solve this problem. I am finding solution from last 4 days. Reporting Service configuratin tool settings Web Serivice URL -  all set to default Report Manager URL - all set to default Environment - Distributed deployment Server1(report_srv) --Windows server 2003, Installed sql server 2008R2 reporting service,

The remote server returned an error: (550) File unavailable (e.g., file not found, no access).

  
Hi.   I have read the other threads regarding this but they do not solve my problem. All i am trying to do is upload a file from the webserver onto another server via FTP. But i get the above error and am at my wits end as to why.   below is the code:   Dim fs As New FileStream("H:\Visual Studio 2005\Websites\Website1\testfile.txt", FileMode.Open) Dim filecontents(fs.Length) As Byte fs.Read(filecontents, 0, fs.Length)   Dim remotePath As String = "ftp://elonwactd.uk.ml.com/apps/files/IPBHVGTRADE/QA5/in/testfile.txt" Dim ftp As FtpWebRequest = FtpWebRequest.Create(remotePath) ftp.Credentials = New System.Net.NetworkCredential("user1", "passwd1") ftp.KeepAlive = False ftp.UseBinary = True   ' (have tried UploadFile as well instead of UploadFileWithUniqueName) ftp.Method = WebRequestMethods.Ftp.UploadFileWithUniqueName     fs.Close()   ftp.GetRequestStream.Write(filecontents, 0, filecontents.Length) ftp.GetRequestStream.Close() ftp.GetResponse.Close()     Below is the stack trace that i get. [WebException: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).]   System.Net.FtpWebRequest.SyncRequestCallback(Object obj) +321   System.Net.FtpWebRequest.RequestCallback(Object obj) +19   System.Net.CommandStream.Abort(Exception e) +163   System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage) +45

The remote server returned an error: (530) Not logged in

  
Hi,

I have below code for deleting the file from ftp, i am getting a error.

"The remote server returned an error: (530) Not logged in. " what could be reason.

public
static void DeleteFile(string serverUri, string userid, string password)

{

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverUri);

request.Credentials =new NetworkCredential("userid", "password");

 

request.Method = WebRequestMethods.Ftp.DeleteFile;

 

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

response.Close();

}


The remote server returned an error: (405) Method Not Allowed.

  
hi i declared,
 
 [OperationContract]
      [WebInvoke(     
      UriTemplate = "/CreateCustomer/cNo/{cNo}/cName/{cName}",
      Method = "POST")]
    bool InsertCustomer(string cNo, string cName);


/*service call*/


 public bool InsertCustomer(string cNo, string cName)
    {
      bool Inserted;
      String connString = ConfigurationManager.ConnectionStrings["connectionstr"].ConnectionString;
      SqlConnection Conn = new SqlConnection(connString);
      Conn.Open();
      SqlCommand Cmd = new SqlCommand();
      Cmd.Connection = Conn;
      Cmd.CommandText = "Insert into Customer Values(cid,cname)";
      Cmd.Parameters.AddWithValue("cid", Convert.ToInt32(cNo));
      Cmd.Parameters.AddWithValue("cname", cName);
      Inserted = Convert.ToBoolean(Cmd.ExecuteNonQuery());
      Conn.Close();
      return Inserted;
    }



/*client code */

  string ServiceUri = "http://localhost:portno/Service.svc/CreateCustomer/" + "cNo" + "/" + TextBox1.Text + "/" + "cName";
      WebRequest addRequest = WebRequest.Create(ServiceUri);
      addRequest.Method = "POST";
      addRequest.ContentType = "application/xml; charset=utf-8";
      addReques

webinvoke method=Post..throws error "The remote server returned an error: (405) Method Not Allowed."

  

hi,

my service defn

 [OperationContract]
      [WebInvoke(     
      UriTemplate = "/CreateCustomer/cNo/{cNo}/cName/{cName}",
      Method = "POST")]
    bool InsertCustomer(string cNo, string cName);


/*service call*/


 public bool InsertCustomer(string cNo, string cName)
    {
      bool Inserted;
      String connString = ConfigurationManager.ConnectionStrings["connectionstr"].ConnectionString;
      SqlConnection Conn = new SqlConnection(connString);
      Conn.Open();
      SqlCommand Cmd = new SqlCommand();
      Cmd.Connection = Conn;
      Cmd.CommandText = "Insert into Customer Values(cid,cname)";
      Cmd.Parameters.AddWithValue("cid", Convert.ToInt32(cNo));
      Cmd.Parameters.AddWithValue("cname", cName);
      Inserted = Convert.ToBoolean(Cmd.ExecuteNonQuery());
      Conn.Close();
      return Inserted;
    }



/*client code */

  string ServiceUri = "http://localhost:portno/Service.svc/CreateCustomer/" + "cNo" + "/" + TextBox1.Text + "/" + "cName";
      WebRequest addRequest = WebRequest.Create(ServiceUri);
      addRequest.Method = "POST";
      addRequest.ContentType = "application/xml; charset=utf-8";
      addRequest.ContentLength = 0;
      WebResponse addResponse = addRequest.GetRespo

The remote server returned an error: (530) Not logged in.

  

I've same issue with my ftp development.

I'm copying the files to ftp server and its working fine with other 2-3 ftp server.

But at one ftp server its giving error saying "Remote Server returned an error: (530) Not logged in."

Even I'm able to connect that ftp server with ftp.exe and ftp software and able to copy/delete files mannually.

 

Please suggest me the solution and I'll very thankful.

I'm using the following code.

 

FileInfo fileInf = new FileInfo(filename);

                string uri = "ftp://" + ftpServerIP + "/" + fileInf.Name;

                FtpWebRequest reqFTP;

 

                // Create FtpWebRequest object from the Uri provided

                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + fileInf.Name));

 

                // Provide the WebPermission Credintials

                reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPasswo

The remote server returned an error: (503) Server Unavailable In SharePoint 2010.

  

I created a web app with claims based authentication ,

basiclly i follwe this blog

http://donalconlon.wordpress.com/2010/02/23/configuring-forms-base-authentication-for-sharepoint-2010-using-iis7/

 

but when i login it throws 503 error

Server Error in '/' Application.

The remote server returned an error: (503) Server Unavailable.

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: (503) Server Unavailable.

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: (503) Server Unavailable.]
  System.Net.HttpWebRequest.GetRespon

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?


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

  

I have a search box on my site. If I implement a search by typing any characters it would come up with the right search result; except one-- ampersand (&) symbol. Whenever I type in this symbol - only this character- mind you, it would come up with the following error: 

 

Server Error in '/' 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:

Line 55:         string name = this.TextBox1.Text;
Line 56:         string tablename;
Line 57:         DataTable dt = NameSearchBeta.NameSearch.NameSearchRequest(account, name,true , out tablename);
Line 58:         if (tablename == "Error")
Line 5

The remote server returned an error: 227 Entering Passive Mode (67,228,53,42,12,130)

  
Hi,

I have writen a ftp client to download files from ftp. while downloading the files from the ftp I;m getting the same error  (The remote server returned an error: 227 Entering Passive Mode (67,228,53,42,12,130)). Particularly I am getting this error in the line
Using response As System.Net.FtpWebResponse = CType(ftp.GetResponse, FtpWebResponse)

I hope you can help me out to solve this problem.

Thanks.

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

  

Hello,

I have a .NET 4.0 Windows client that is consuming a WCF service that is hosted in IIS7 on a Windows Server 2008 Standard machine.

My Windows client application calls the WCF service to perform database synchronization.  The process can take some time depending on the amount of data that is being synchronized.

After about 3 minutes and 15 seconds, I receive the following exception:

Exception Type: System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message: "The connection to the website was closed by the site or by one of its servers"
Inner Exception Type: System.Net.WebException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Inner Exception Message: "The remote server returned an error: (500) Internal Server Error."

I can't figure out what is wrong.  I have tried the following:

  1. In IIS > my site > feature view > Error Pages > select 500 error > edit > selected detail error. Nothing extra was shown.
  2. Enabled WCF tracing on the server and the client.  Server trace log didn't produce any errors and the client trace log generated the error noted above
  3. Increased the follow
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend