Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Wed, 5 Dec 2007 09:47:01 -0800,    group: microsoft.public.xml.soap        back       


Using HttpResponse succeeds only after several tries   
Using the below code for posting xml content throws "Badrequest (400)" and 
only succeeeds after 3 or 4 tries. Hugely appreciate if somebody knows how to 
fix this.

oHttpRequest = 
(HttpWebRequest)WebRequest.Create(GlobalConfiguration.GetPartnerSetting(PARTNER_NAME, "ResidentURL"));
			oHttpRequest.Timeout = 
int.Parse(GlobalConfiguration.GetPartnerSetting(PARTNER_NAME, 
"GatewayTimeoutMS"));
			oHttpRequest.Method = "post";
			oHttpRequest.ContentType = "text/xml";
			oHttpRequest.ContentLength = arrPostData.Length;
           //The foloowing 
            oHttpRequest.AllowWriteStreamBuffering = true;
            oHttpRequest.KeepAlive = true;

			oRequestStream = oHttpRequest.GetRequestStream();
			oRequestStream.Write(arrPostData, 0, arrPostData.Length);
            oRequestStream.Flush();
			oRequestStream.Close();

			//Make the request to the remote server
			try
			{
                                                     //This is where it 
throws the BadRequest error
				oHttpResponse = (HttpWebResponse)oHttpRequest.GetResponse();
			}
			catch (Exception ex)
			{
				throw new ApplicationException("The remote server could not be 
contacted.  " + ex.Message + ".", ex);
			}
date: Wed, 5 Dec 2007 09:47:01 -0800   author:   redmond

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us