Thursday, January 3, 2008

JBOSS for .Net Issue (505)

JBOSS has known issue when talking to .NET Client.

You will receive this error.
The request failed with HTTP status 505: HTTP Version Not Supported.


This error happened because .NET does not implement HTTP 1.1 properly (specifically contiuations), therefore the only way you can fix this is to force the client to use HTTP 1.0.

You can enable in on Server Side / Client side.

On Server Side:
adding the following option (in bold) to your http connector tag in your tomcat server.xml file.
Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
restrictedUserAgents="^.*MS Web Services Client Protocol.*$"
connectionTimeout="20000" disableUploadTimeout="true"

On Client Side:
Change .NET webservice to use HTTP 1.0 by adding the following code to your proxy class.
 protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest httpReq = (HttpWebRequest)base.GetWebRequest(uri);
httpReq.ProtocolVersion = System.Net.HttpVersion.Version10;
return httpReq;
}


No comments: