We have an ASP.Net web application which calls Web Services deployed in the same virtual directory. The call returns without any problem in the development machine. But when deployed to the production server, it gives back a '400 Bad Request' error. The call was made by creating a WebRequest and setting the SoapAction header and then WebResponse.GetRepsonseStream() gets the SOAP response. Temporarily, we fixed the issue by making the call using the proxy generated.
Can anyone suggest a proper way of calling web services using WebRequest and WebResponse without encountering the 400 error?