Basic Authentication usage resulting in System.Net.WebException: The request failed with HTT

I'm currently writing a C# client accessing a java web service supplied

by Apache Axis. The java web service requires basic authorization

so I'm configuring my generated proxy as follows:


MyProxy

proxy = new MyProxy();

proxy.PreAuthenticate = true;

proxy.Url = http://someserver/somepath/services/ProxyService";

proxy.Credentials = new

NetworkCredential("someUser","somePassword");

proxy.invokeMyMethod();

When I invoke the call the first time, I receive this exception:

System.Net.WebException: The request failed with HTTP status 505: HTTP Version Not Supported.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

I monitored the traffic going back and forth via tcpmon, a tool

provided by Axis and I can see the initial request sent forward with no

authorization sent in the header. A 401 response is sent back,

and the request is resent with the credentials, at which point I'll get

the before mentioned error, and then the subsequent requests will go

through without a problem as the credentials are sent each time.

Has anyone ran into this before, is there a problem with my configuration or am I lacking configuration of some sort.

I appreciate any help that could be provided on the subject.

[1631 byte] By [AllenJunior] at [2007-12-24]
# 1

Seems to me like a problem with your webserver. Can you get a network trace that I can look at? You can use the instructions found on this blog: http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx

Make sure to remove any private information (including the hash of your password in the http traffic. You can e-mail me the file if you don't want to post it on this thread.

JonCole at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2
Below is the log file. You can see where it resends the request

after the 401 response, but that resubmission is responded to by a 505

from the Tomcat servlet container. I removed the soap body for

brevity. So is this a Tomcat bug? It appears the

resubmission should work.

System.Net Verbose: 0 : [5816] WebRequest::Create(http://localhost:8080/context/service)

System.Net Verbose: 0 : [5816] HttpWebRequest#58222774::HttpWebRequest(http://localhost:8080/context/service#991641721)

System.Net Verbose: 0 : [5816] Exiting HttpWebRequest#58222774::HttpWebRequest()

System.Net Verbose: 0 : [5816] Exiting WebRequest::Create() -> HttpWebRequest#58222774

System.Net Verbose: 0 : [5816] HttpWebRequest#58222774::GetRequestStream()

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with ServicePoint#10738850

System.Net Information: 0 : [5816] Associating Connection#42991209 with HttpWebRequest#58222774

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Socket(InterNetwork#2)

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Socket()

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Connect(1:8080#16785391)

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Connect()

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with ConnectStream#51038673

System.Net Verbose: 0 : [5816] Exiting

HttpWebRequest#58222774::GetRequestStream() ->

ConnectStream#51038673

System.Net Verbose: 0 : [5816] ConnectStream#51038673::Write()

System.Net Verbose: 0 : [5816] Data from ConnectStream#51038673::Write

System.Net Verbose: 0 : [5816] 00000000 : 3C 3F 78 6D 6C 20 76 65-72 73 69 6F 6E 3D 22 31 : <?xml version="1

System.Net Verbose: 0 : [5816] 00000010 : 2E 30 22 20 65 6E 63 6F-64 69 6E 67 3D 22 75 74 : .0" encoding="ut

System.Net Verbose: 0 : [5816] 00000020 : 66 2D 38 22 3F 3E 3C 73-6F 61 70 3A 45 6E 76 65 : f-8"?><soap:Enve

System.Net Verbose: 0 : [5816] 00000030 : 6C 6F 70 65 20 78 6D 6C-6E 73 3A 73 6F 61 70 3D : lope xmlns:soap=

System.Net Verbose: 0 : [5816] 00000040 : 22 68 74 74 70 3A 2F 2F-73 63 68 65 6D 61 73 2E : "http://schemas.

System.Net Verbose: 0 : [5816] 00000050 : 78 6D 6C 73 6F 61 70 2E-6F 72 67 2F 73 6F 61 70 : xmlsoap.org/soap

System.Net Verbose: 0 : [5816] 00000060 : 2F 65 6E 76 65 6C 6F 70-65 2F 22 20 78 6D 6C 6E : /envelope/" xmln

System.Net Verbose: 0 : [5816] 00000070 : 73 3A 78 73 69 3D 22 68-74 74 70 3A 2F 2F 77 77 : s:xsi="http://ww

System.Net Verbose: 0 : [5816] 00000080 : 77 2E 77 33 2E 6F 72 67-2F 32 30 30 31 2F 58 4D : w.w3.org/2001/XM

System.Net Verbose: 0 : [5816] 00000090 : 4C 53 63 68 65 6D 61 2D-69 6E 73 74 61 6E 63 65 : LSchema-instance

System.Net Verbose: 0 : [5816] 000000A0 : 22 20 78 6D 6C 6E 73 3A-78 73 64 3D 22 68 74 74 : " xmlns:xsd="htt

System.Net Verbose: 0 : [5816] 000000B0 : 70 3A 2F 2F 77 77 77 2E-77 33 2E 6F 72 67 2F 32 : p://www.w3.org/2

System.Net Verbose: 0 : [5816] 000000C0 : 30 30 31 2F 58 4D 4C 53-63 68 65 6D 61 22 3E 3C : 001/XMLSchema"><

System.Net Verbose: 0 : [5816] 000000D0 : 73 6F 61 70 3A 42 6F 64-79 3E 3C 75 70 6C 6F 61 : soap:Body>

System.Net Verbose: 0 : [5816] Exiting ConnectStream#51038673::Write()

System.Net Verbose: 0 : [5816] ConnectStream#51038673::Write()

System.Net Verbose: 0 : [5816] Data from ConnectStream#51038673::Write

System.Net Verbose: 0 : [5816] 00000000 : 3C 2F 73 6F 61 70 3A 42-6F 64 79 3E 3C 2F 73 6F : </soap:Body></so

System.Net Verbose: 0 : [5816] 00000010 : 61 70 3A 45 6E 76 65 6C-6F 70

65

3E

: ap:Envelope>

System.Net Verbose: 0 : [5816] Exiting ConnectStream#51038673::Write()

System.Net Verbose: 0 : [5816] ConnectStream#51038673::Close()

System.Net Verbose: 0 : [5816] Exiting ConnectStream#51038673::Close()

System.Net Verbose: 0 : [5816] HttpWebRequest#58222774::GetResponse()

System.Net Information: 0 : [5816] HttpWebRequest#58222774 - Request:

POST /context/service/DashboardChartAdministrationService HTTP/1.1

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Send()

System.Net.Sockets Verbose: 0 : [5816] Data from Socket#38785534::Send

System.Net.Sockets Verbose: 0 : [5816] 00000000 : 50 4F 53 54 20 2F 6F 70-65 6E 61 70 69 2F 73 65 : POST /context/se

System.Net.Sockets Verbose: 0 : [5816] 00000010 : 72 76 69 63 65 73 2F 44-61 73 68 62 6F 61 72 64 : rvice/Dashboard

System.Net.Sockets Verbose: 0 : [5816] 00000020 : 43 68 61 72 74 41 64 6D-69 6E 69 73 74 72 61 74 : ChartAdministrat

System.Net.Sockets Verbose: 0 : [5816] 00000030 : 69 6F 6E 53 65 72 76 69-63 65 20 48 54 54 50 2F : ionService HTTP/

System.Net.Sockets Verbose: 0 : [5816] 00000040 : 31 2E 31 0D 0A 55 73 65-72 2D 41 67 65 6E 74 3A : 1.1..User-Agent:

System.Net.Sockets Verbose: 0 : [5816] 00000050 : 20 4D 6F 7A 69 6C 6C 61-2F 34 2E 30 20 28 63 6F : Mozilla/4.0 (co

System.Net.Sockets Verbose: 0 : [5816] 00000060 : 6D 70 61 74 69 62 6C 65-3B 20 4D 53 49 45 20 36 : mpatible; MSIE 6

System.Net.Sockets Verbose: 0 : [5816] 00000070 : 2E 30 3B 20 4D 53 20 57-65 62 20 53 65 72 76 69 : .0; MS Web Servi

System.Net.Sockets Verbose: 0 : [5816] 00000080 : 63 65 73 20 43 6C 69 65-6E 74 20 50 72 6F 74 6F : ces Client Proto

System.Net.Sockets Verbose: 0 : [5816] 00000090 : 63 6F 6C 20 32 2E 30 2E-35 30 37 32 37 2E 34 32 : col 2.0.50727.42

System.Net.Sockets Verbose: 0 : [5816] 000000A0 : 29 0D 0A 43 6F 6E 74 65-6E 74 2D 54 79 70 65 3A : )..Content-Type:

System.Net.Sockets Verbose: 0 : [5816] 000000B0 : 20 74 65 78 74 2F 78 6D-6C 3B 20 63 68 61 72 73 : text/xml; chars

System.Net.Sockets Verbose: 0 : [5816] 000000C0 : 65 74 3D 75 74 66 2D 38-0D 0A 53 4F 41 50 41 63 : et=utf-8..SOAPAc

System.Net.Sockets Verbose: 0 : [5816] 000000D0 : 74 69 6F 6E 3A 20 22 22-0D 0A 48 6F 73 74 3A 20 : tion: ""..Host:

System.Net.Sockets Verbose: 0 : [5816] 000000E0 : 6C 6F 63 61 6C 68 6F 73-74 3A 38 30 38 30 0D 0A : localhost:8080..

System.Net.Sockets Verbose: 0 : [5816] 000000F0 : 43 6F 6E 74 65 6E 74 2D-4C 65 6E 67 74 68 3A 20 : Content-Length:

System.Net.Sockets Verbose: 0 : [5816] 00000100 : 31 30 31 34 0D 0A 45 78-70 65 63 74 3A 20 31 30 : 1014..Expect: 10

System.Net.Sockets Verbose: 0 : [5816] 00000110 : 30 2D 63 6F 6E 74 69 6E-75 65 0D 0A 43 6F 6E 6E : 0-continue..Conn

System.Net.Sockets Verbose: 0 : [5816] 00000120 : 65 63 74 69 6F 6E 3A 20-4B 65 65 70 2D 41 6C 69 : ection: Keep-Ali

System.Net.Sockets Verbose: 0 : [5816] 00000130 : 76 65 0D 0A 0D

0A

: ve....

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Send() -> 310#310

System.Net Information: 0 : [5816] ConnectStream#51038673 - Sending headers

{

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.42)

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

Host: localhost:8080

Content-Length: 1014

Expect: 100-continue

Connection: Keep-Alive

}.

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Receive()

System.Net.Sockets Verbose: 0 : [5816] Data from Socket#38785534::Receive

System.Net.Sockets Verbose: 0 : [5816] (printing 1024 out of 1149)

System.Net.Sockets Verbose: 0 : [5816] 00000000 : 48 54 54 50 2F 31 2E 31-20 34 30 31 20 55 6E 61 : HTTP/1.1 401 Una

System.Net.Sockets Verbose: 0 : [5816] 00000010 : 75 74 68 6F 72 69 7A 65-64 0D 0A 53 65 72 76 65 : uthorized..Serve

System.Net.Sockets Verbose: 0 : [5816] 00000020 : 72 3A 20 41 70 61 63 68-65 2D 43 6F 79 6F 74 65 : r: Apache-Coyote

System.Net.Sockets Verbose: 0 : [5816] 00000030 : 2F 31 2E 31 0D 0A 57 57-57 2D 41 75 74 68 65 6E : /1.1..WWW-Authen

System.Net.Sockets Verbose: 0 : [5816] 00000040 : 74 69 63 61 74 65 3A 20-42 61 73 69 63 20 72 65 : ticate: Basic re

System.Net.Sockets Verbose: 0 : [5816] 00000050 : 61 6C 6D 3D 22 6C 6F 63-61 6C 68 6F 73 74 3A 38 : alm="localhost:8

System.Net.Sockets Verbose: 0 : [5816] 00000060 : 30 38 30 22 0D 0A 43 6F-6E 74 65 6E 74 2D 54 79 : 080"..Content-Ty

System.Net.Sockets Verbose: 0 : [5816] 00000070 : 70 65 3A 20 74 65 78 74-2F 68 74 6D 6C 3B 63 68 : pe: text/html;ch

System.Net.Sockets Verbose: 0 : [5816] 00000080 : 61 72 73 65 74 3D 75 74-66 2D 38 0D 0A 43 6F 6E : arset=utf-8..Con

System.Net.Sockets Verbose: 0 : [5816] 00000090 : 74 65 6E 74 2D 4C 65 6E-67 74 68 3A 20 39 34 38 : tent-Length: 948

System.Net.Sockets Verbose: 0 : [5816] 000000A0 : 0D 0A 44 61 74 65 3A 20-46 72 69 2C 20 30 35 20 : ..Date: Fri, 05

System.Net.Sockets Verbose: 0 : [5816] 000000B0 : 4D 61 79 20 32 30 30 36-20 32 31 3A 34 30 3A 31 : May 2006 21:40:1

System.Net.Sockets Verbose: 0 : [5816] 000000C0 : 39 20 47 4D 54 0D 0A 0D-0A 3C 68 74 6D 6C 3E 3C : 9 GMT....<html><

System.Net.Sockets Verbose: 0 : [5816] 000000D0 : 68 65 61 64 3E 3C 74 69-74 6C 65 3E 41 70 61 63 : head><title>Apac

System.Net.Sockets Verbose: 0 : [5816] 000000E0 : 68 65 20 54 6F 6D 63 61-74 2F 35 2E 35 20 2D 20 : he Tomcat/5.5 -

System.Net.Sockets Verbose: 0 : [5816] 000000F0 : 45 72 72 6F 72 20 72 65-70 6F 72 74 3C 2F 74 69 : Error report</ti

System.Net.Sockets Verbose: 0 : [5816] 00000100 : 74 6C 65 3E 3C 73 74 79-6C 65 3E 3C 21 2D 2D 48 : tle><style><!--H

System.Net.Sockets Verbose: 0 : [5816] 00000110 : 31 20 7B 66 6F 6E 74 2D-66 61 6D 69 6C 79 3A 54 : 1 {font-family:T

System.Net.Sockets Verbose: 0 : [5816] 00000120 : 61 68 6F 6D 61 2C 41 72-69 61 6C 2C 73 61 6E 73 : ahoma,Arial,sans

System.Net.Sockets Verbose: 0 : [5816] 00000130 : 2D 73 65 72 69 66 3B 63-6F 6C 6F 72 3A 77 68 69 : -serif;color:whi

System.Net.Sockets Verbose: 0 : [5816] 00000140 : 74 65 3B 62 61 63 6B 67-72 6F 75 6E 64 2D 63 6F : te;background-co

System.Net.Sockets Verbose: 0 : [5816] 00000150 : 6C 6F 72 3A 23 35 32 35-44 37 36 3B 66 6F 6E 74 : lor:#525D76;font

System.Net.Sockets Verbose: 0 : [5816] 00000160 : 2D 73 69 7A 65 3A 32 32-70 78 3B 7D 20 48 32 20 : -size:22px;} H2

System.Net.Sockets Verbose: 0 : [5816] 00000170 : 7B 66 6F 6E 74 2D 66 61-6D 69 6C 79 3A 54 61 68 : {font-family:Tah

System.Net.Sockets Verbose: 0 : [5816] 00000180 : 6F 6D 61 2C 41 72 69 61-6C 2C 73 61 6E 73 2D 73 : oma,Arial,sans-s

System.Net.Sockets Verbose: 0 : [5816] 00000190 : 65 72 69 66 3B 63 6F 6C-6F 72 3A 77 68 69 74 65 : erif;color:white

System.Net.Sockets Verbose: 0 : [5816] 000001A0 : 3B 62 61 63 6B 67 72 6F-75 6E 64 2D 63 6F 6C 6F : ;background-colo

System.Net.Sockets Verbose: 0 : [5816] 000001B0 : 72 3A 23 35 32 35 44 37-36 3B 66 6F 6E 74 2D 73 : r:#525D76;font-s

System.Net.Sockets Verbose: 0 : [5816] 000001C0 : 69 7A 65 3A 31 36 70 78-3B 7D 20 48 33 20 7B 66 : ize:16px;} H3 {f

System.Net.Sockets Verbose: 0 : [5816] 000001D0 : 6F 6E 74 2D 66 61 6D 69-6C 79 3A 54 61 68 6F 6D : ont-family:Tahom

System.Net.Sockets Verbose: 0 : [5816] 000001E0 : 61 2C 41 72 69 61 6C 2C-73 61 6E 73 2D 73 65 72 : a,Arial,sans-ser

System.Net.Sockets Verbose: 0 : [5816] 000001F0 : 69 66 3B 63 6F 6C 6F 72-3A 77 68 69 74 65 3B 62 : if;color:white;b

System.Net.Sockets Verbose: 0 : [5816] 00000200 : 61 63 6B 67 72 6F 75 6E-64 2D 63 6F 6C 6F 72 3A : ackground-color:

System.Net.Sockets Verbose: 0 : [5816] 00000210 : 23 35 32 35 44 37 36 3B-66 6F 6E 74 2D 73 69 7A : #525D76;font-siz

System.Net.Sockets Verbose: 0 : [5816] 00000220 : 65 3A 31 34 70 78 3B 7D-20 42 4F 44 59 20 7B 66 : e:14px;} BODY {f

System.Net.Sockets Verbose: 0 : [5816] 00000230 : 6F 6E 74 2D 66 61 6D 69-6C 79 3A 54 61 68 6F 6D : ont-family:Tahom

System.Net.Sockets Verbose: 0 : [5816] 00000240 : 61 2C 41 72 69 61 6C 2C-73 61 6E 73 2D 73 65 72 : a,Arial,sans-ser

System.Net.Sockets Verbose: 0 : [5816] 00000250 : 69 66 3B 63 6F 6C 6F 72-3A 62 6C 61 63 6B 3B 62 : if;color:black;b

System.Net.Sockets Verbose: 0 : [5816] 00000260 : 61 63 6B 67 72 6F 75 6E-64 2D 63 6F 6C 6F 72 3A : ackground-color:

System.Net.Sockets Verbose: 0 : [5816] 00000270 : 77 68 69 74 65 3B 7D 20-42 20 7B 66 6F 6E 74 2D : white;} B {font-

System.Net.Sockets Verbose: 0 : [5816] 00000280 : 66 61 6D 69 6C 79 3A 54-61 68 6F 6D 61 2C 41 72 : family:Tahoma,Ar

System.Net.Sockets Verbose: 0 : [5816] 00000290 : 69 61 6C 2C 73 61 6E 73-2D 73 65 72 69 66 3B 63 : ial,sans-serif;c

System.Net.Sockets Verbose: 0 : [5816] 000002A0 : 6F 6C 6F 72 3A 77 68 69-74 65 3B 62 61 63 6B 67 : olor:white;backg

System.Net.Sockets Verbose: 0 : [5816] 000002B0 : 72 6F 75 6E 64 2D 63 6F-6C 6F 72 3A 23 35 32 35 : round-color:#525

System.Net.Sockets Verbose: 0 : [5816] 000002C0 : 44 37 36 3B 7D 20 50 20-7B 66 6F 6E 74 2D 66 61 : D76;} P {font-fa

System.Net.Sockets Verbose: 0 : [5816] 000002D0 : 6D 69 6C 79 3A 54 61 68-6F 6D 61 2C 41 72 69 61 : mily:Tahoma,Aria

System.Net.Sockets Verbose: 0 : [5816] 000002E0 : 6C 2C 73 61 6E 73 2D 73-65 72 69 66 3B 62 61 63 : l,sans-serif;bac

System.Net.Sockets Verbose: 0 : [5816] 000002F0 : 6B 67 72 6F 75 6E 64 3A-77 68 69 74 65 3B 63 6F : kground:white;co

System.Net.Sockets Verbose: 0 : [5816] 00000300 : 6C 6F 72 3A 62 6C 61 63-6B 3B 66 6F 6E 74 2D 73 : lor:black;font-s

System.Net.Sockets Verbose: 0 : [5816] 00000310 : 69 7A 65 3A 31 32 70 78-3B 7D 41 20 7B 63 6F 6C : ize:12px;}A {col

System.Net.Sockets Verbose: 0 : [5816] 00000320 : 6F 72 20 3A 20 62 6C 61-63 6B 3B 7D 41 2E 6E 61 : or : black;}A.na

System.Net.Sockets Verbose: 0 : [5816] 00000330 : 6D 65 20 7B 63 6F 6C 6F-72 20 3A 20 62 6C 61 63 : me {color : blac

System.Net.Sockets Verbose: 0 : [5816] 00000340 : 6B 3B 7D 48 52 20 7B 63-6F 6C 6F 72 20 3A 20 23 : k;}HR {color : #

System.Net.Sockets Verbose: 0 : [5816] 00000350 : 35 32 35 44 37 36 3B 7D-2D 2D 3E 3C 2F 73 74 79 : 525D76;}--></sty

System.Net.Sockets Verbose: 0 : [5816] 00000360 : 6C 65 3E 20 3C 2F 68 65-61 64 3E 3C 62 6F 64 79 : le> </head><body

System.Net.Sockets Verbose: 0 : [5816] 00000370 : 3E 3C 68 31 3E 48 54 54-50 20 53 74 61 74 75 73 : ><h1>HTTP Status

System.Net.Sockets Verbose: 0 : [5816] 00000380 : 20 34 30 31 20 2D 20

3C-2F 68 31 3E 3C 48 52 20 : 401 - </h1><HR

System.Net.Sockets Verbose: 0 : [5816] 00000390 : 73 69 7A 65 3D 22 31 22-20 6E 6F 73 68 61 64 65 : size="1" noshade

System.Net.Sockets Verbose: 0 : [5816] 000003A0 : 3D 22 6E 6F 73 68 61 64-65 22 3E 3C 70 3E 3C 62 : ="noshade">

<b

System.Net.Sockets Verbose: 0 : [5816] 000003B0 : 3E 74 79 70 65 3C 2F 62-3E 20 53 74 61 74 75 73 : >type</b> Status

System.Net.Sockets Verbose: 0 : [5816] 000003C0 : 20 72 65 70 6F 72 74

3C-2F 70 3E 3C 70 3E 3C 62 : report

<b

System.Net.Sockets Verbose: 0 : [5816] 000003D0 : 3E 6D 65 73 73 61 67

65-3C 2F 62 3E 20 3C 75 3E : >message</b> <u>

System.Net.Sockets Verbose: 0 : [5816] 000003E0 : 3C 2F 75 3E 3C 2F 70

3E-3C 70 3E 3C 62 3E 64 65 : </u>

<b>de

System.Net.Sockets Verbose: 0 : [5816] 000003F0 : 73 63 72 69 70 74 69 6F-6E 3C 2F 62 3E 20 3C 75 : scription</b> <u

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Receive() -> 1149#1149

System.Net Information: 0 : [5816] Connection#42991209 - Received

status line: Version=1.1, StatusCode=401,

StatusDescription=Unauthorized.

System.Net Information: 0 : [5816] Connection#42991209 - Received headers

{

Content-Length: 948

Content-Type: text/html;charset=utf-8

Date: Fri, 05 May 2006 21:40:19 GMT

Server: Apache-Coyote/1.1

WWW-Authenticate: Basic realm="localhost:8080"

}.

System.Net Information: 0 : [5816] ConnectStream#46994722::ConnectStream(Buffered 948 bytes.)

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::MultipleSend()

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::MultipleSend()

System.Net Verbose: 0 : [5816] Data from ConnectStream#51038673::ResubmitWrite

System.Net Verbose: 0 : [5816] 00000000 : 3C 3F 78 6D 6C 20 76 65-72 73 69 6F 6E 3D 22 31 : <?xml version="1

System.Net Verbose: 0 : [5816] 00000010 : 2E 30 22 20 65 6E 63 6F-64 69 6E 67 3D 22 75 74 : .0" encoding="ut

System.Net Verbose: 0 : [5816] 00000020 : 66 2D 38 22 3F 3E 3C 73-6F 61 70 3A 45 6E 76 65 : f-8"?><soap:Enve

System.Net Verbose: 0 : [5816] 00000030 : 6C 6F 70 65 20 78 6D 6C-6E 73 3A 73 6F 61 70 3D : lope xmlns:soap=

System.Net Verbose: 0 : [5816] 00000040 : 22 68 74 74 70 3A 2F 2F-73 63 68 65 6D 61 73 2E : "http://schemas.

System.Net Verbose: 0 : [5816] 00000050 : 78 6D 6C 73 6F 61 70 2E-6F 72 67 2F 73 6F 61 70 : xmlsoap.org/soap

System.Net Verbose: 0 : [5816] 00000060 : 2F 65 6E 76 65 6C 6F 70-65 2F 22 20 78 6D 6C 6E : /envelope/" xmln

System.Net Verbose: 0 : [5816] 00000070 : 73 3A 78 73 69 3D 22 68-74 74 70 3A 2F 2F 77 77 : s:xsi="http://ww

System.Net Verbose: 0 : [5816] 00000080 : 77 2E 77 33 2E 6F 72 67-2F 32 30 30 31 2F 58 4D : w.w3.org/2001/XM

System.Net Verbose: 0 : [5816] 00000090 : 4C 53 63 68 65 6D 61 2D-69 6E 73 74 61 6E 63 65 : LSchema-instance

System.Net Verbose: 0 : [5816] 000000A0 : 22 20 78 6D 6C 6E 73 3A-78 73 64 3D 22 68 74 74 : " xmlns:xsd="htt

System.Net Verbose: 0 : [5816] 000000B0 : 70 3A 2F 2F 77 77 77 2E-77 33 2E 6F 72 67 2F 32 : p://www.w3.org/2

System.Net Verbose: 0 : [5816] 000000C0 : 30 30 31 2F 58 4D 4C 53-63 68 65 6D 61 22 3E 3C : 001/XMLSchema"><

System.Net Verbose: 0 : [5816] 000000D0 : 73 6F 61 70 3A 42 6F 64-79 3E 3C 75 70 6C 6F 61 : soap:Body></soap

System.Net Verbose: 0 : [5816] 000003E0 : 3A 42 6F 64 79 3E 3C 2F-73 6F 61 70 3A 45 6E 76 : :Body></soap:Env

System.Net Verbose: 0 : [5816] 000003F0 : 65 6C 6F 70 65

3E

: elope>

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with ConnectStream#46994722

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with HttpWebResponse#20669667

System.Net Information: 0 : [5816] Enumerating security packages:

System.Net Information: 0 : [5816] Negotiate

System.Net Information: 0 : [5816] Kerberos

System.Net Information: 0 : [5816] NTLM

System.Net Information: 0 : [5816] Microsoft Unified Security Protocol Provider

System.Net Information: 0 : [5816] Schannel

System.Net Information: 0 : [5816] WDigest

System.Net Information: 0 : [5816] DPA

System.Net Information: 0 : [5816] Digest

System.Net Information: 0 : [5816] MSN

System.Net Warning: 0 : [5816] HttpWebRequest#58222774::() - Resubmitting request.

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with ServicePoint#10738850

System.Net Information: 0 : [5816] Associating Connection#42991209 with HttpWebRequest#58222774

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with ConnectStream#62549446

System.Net Information: 0 : [5816] HttpWebRequest#58222774 - Request:

POST /context/service/DashboardChartAdministrationService HTTP/1.1

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Send()

System.Net.Sockets Verbose: 0 : [5816] Data from Socket#38785534::Send

System.Net.Sockets Verbose: 0 : [5816] 00000000 : 50 4F 53 54 20 2F 6F 70-65 6E 61 70 69 2F 73 65 : POST /openapi/se

System.Net.Sockets Verbose: 0 : [5816] 00000010 : 72 76 69 63 65 73 2F 44-61 73 68 62 6F 61 72 64 : rvices/Dashboard

System.Net.Sockets Verbose: 0 : [5816] 00000020 : 43 68 61 72 74 41 64 6D-69 6E 69 73 74 72 61 74 : ChartAdministrat

System.Net.Sockets Verbose: 0 : [5816] 00000030 : 69 6F 6E 53 65 72 76 69-63 65 20 48 54 54 50 2F : ionService HTTP/

System.Net.Sockets Verbose: 0 : [5816] 00000040 : 31 2E 31 0D 0A 55 73 65-72 2D 41 67 65 6E 74 3A : 1.1..User-Agent:

System.Net.Sockets Verbose: 0 : [5816] 00000050 : 20 4D 6F 7A 69 6C 6C 61-2F 34 2E 30 20 28 63 6F : Mozilla/4.0 (co

System.Net.Sockets Verbose: 0 : [5816] 00000060 : 6D 70 61 74 69 62 6C 65-3B 20 4D 53 49 45 20 36 : mpatible; MSIE 6

System.Net.Sockets Verbose: 0 : [5816] 00000070 : 2E 30 3B 20 4D 53 20 57-65 62 20 53 65 72 76 69 : .0; MS Web Servi

System.Net.Sockets Verbose: 0 : [5816] 00000080 : 63 65 73 20 43 6C 69 65-6E 74 20 50 72 6F 74 6F : ces Client Proto

System.Net.Sockets Verbose: 0 : [5816] 00000090 : 63 6F 6C 20 32 2E 30 2E-35 30 37 32 37 2E 34 32 : col 2.0.50727.42

System.Net.Sockets Verbose: 0 : [5816] 000000A0 : 29 0D 0A 43 6F 6E 74 65-6E 74 2D 54 79 70 65 3A : )..Content-Type:

System.Net.Sockets Verbose: 0 : [5816] 000000B0 : 20 74 65 78 74 2F 78 6D-6C 3B 20 63 68 61 72 73 : text/xml; chars

System.Net.Sockets Verbose: 0 : [5816] 000000C0 : 65 74 3D 75 74 66 2D 38-0D 0A 53 4F 41 50 41 63 : et=utf-8..SOAPAc

System.Net.Sockets Verbose: 0 : [5816] 000000D0 : 74 69 6F 6E 3A 20 22 22-0D 0A 41 75 74 68 6F 72 : tion: ""..Author

System.Net.Sockets Verbose: 0 : [5816] 000000E0 : 69 7A 61 74 69 6F 6E 3A-20 42 61 73 69 63 20 5A : ization: Basic P

System.Net.Sockets Verbose: 0 : [5816] 000000F0 : 47 46 7A 61 44 70 31 63-47 78 76 59 57 52 31 63 : laceholder

System.Net.Sockets Verbose: 0 : [5816] 00000100 : 32 56 79 0D 0A 48 6F 73-74 3A 20 6C 6F 63 61 6C : ..Host: local

System.Net.Sockets Verbose: 0 : [5816] 00000110 : 68 6F 73 74 3A 38 30 38-30 0D 0A 43 6F 6E 74 65 : host:8080..Conte

System.Net.Sockets Verbose: 0 : [5816] 00000120 : 6E 74 2D 4C 65 6E 67 74-68 3A 20 31 30 31 34 0D : nt-Length: 1014.

System.Net.Sockets Verbose: 0 : [5816] 00000130 : 0A 45 78 70 65 63 74 3A-20 31 30 30 2D 63 6F 6E : .Expect: 100-con

System.Net.Sockets Verbose: 0 : [5816] 00000140 : 74 69 6E 75 65 0D 0A

0D-0A

: tinue....

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Send() -> 329#329

System.Net Information: 0 : [5816] ConnectStream#62549446 - Sending headers

{

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.42)

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

Authorization: Basic <PlaceHolder>

Host: localhost:8080

Content-Length: 1014

Expect: 100-continue

}.

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::MultipleSend()

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::MultipleSend()

System.Net Verbose: 0 : [5816] Data from ConnectStream#62549446::ResubmitWrite

System.Net Verbose: 0 : [5816] 00000000 : 3C 3F 78 6D 6C 20 76 65-72 73 69 6F 6E 3D 22 31 : <?xml version="1

System.Net Verbose: 0 : [5816] 00000010 : 2E 30 22 20 65 6E 63 6F-64 69 6E 67 3D 22 75 74 : .0" encoding="ut

System.Net Verbose: 0 : [5816] 00000020 : 66 2D 38 22 3F 3E 3C 73-6F 61 70 3A 45 6E 76 65 : f-8"?><soap:Enve

System.Net Verbose: 0 : [5816] 00000030 : 6C 6F 70 65 20 78 6D 6C-6E 73 3A 73 6F 61 70 3D : lope xmlns:soap=

System.Net Verbose: 0 : [5816] 00000040 : 22 68 74 74 70 3A 2F 2F-73 63 68 65 6D 61 73 2E : "http://schemas.

System.Net Verbose: 0 : [5816] 00000050 : 78 6D 6C 73 6F 61 70 2E-6F 72 67 2F 73 6F 61 70 : xmlsoap.org/soap

System.Net Verbose: 0 : [5816] 00000060 : 2F 65 6E 76 65 6C 6F 70-65 2F 22 20 78 6D 6C 6E : /envelope/" xmln

System.Net Verbose: 0 : [5816] 00000070 : 73 3A 78 73 69 3D 22 68-74 74 70 3A 2F 2F 77 77 : s:xsi="http://ww

System.Net Verbose: 0 : [5816] 00000080 : 77 2E 77 33 2E 6F 72 67-2F 32 30 30 31 2F 58 4D : w.w3.org/2001/XM

System.Net Verbose: 0 : [5816] 00000090 : 4C 53 63 68 65 6D 61 2D-69 6E 73 74 61 6E 63 65 : LSchema-instance

System.Net Verbose: 0 : [5816] 000000A0 : 22 20 78 6D 6C 6E 73 3A-78 73 64 3D 22 68 74 74 : " xmlns:xsd="htt

System.Net Verbose: 0 : [5816] 000000B0 : 70 3A 2F 2F 77 77 77 2E-77 33 2E 6F 72 67 2F 32 : p://www.w3.org/2

System.Net Verbose: 0 : [5816] 000000C0 : 30 30 31 2F 58 4D 4C 53-63 68 65 6D 61 22 3E 3C : 001/XMLSchema"></soap:Env

System.Net Verbose: 0 : [5816] 000003F0 : 65 6C 6F 70 65

3E

: elope>

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Receive()

System.Net.Sockets Verbose: 0 : [5816] Data from Socket#38785534::Receive

System.Net.Sockets Verbose: 0 : [5816] 00000000 : 48 54 54 50 2F 31 2E 31-20 35 30 35 20 48 54 54 : HTTP/1.1 505 HTT

System.Net.Sockets Verbose: 0 : [5816] 00000010 : 50 20 56 65 72 73 69 6F-6E 20 4E 6F 74 20 53 75 : P Version Not Su

System.Net.Sockets Verbose: 0 : [5816] 00000020 : 70 70 6F 72 74 65 64 0D-0A 53 65 72 76 65 72 3A : pported..Server:

System.Net.Sockets Verbose: 0 : [5816] 00000030 : 20 41 70 61 63 68 65 2D-43 6F 79 6F 74 65 2F 31 : Apache-Coyote/1

System.Net.Sockets Verbose: 0 : [5816] 00000040 : 2E 31 0D 0A 44 61 74 65-3A 20 46 72 69 2C 20 30 : .1..Date: Fri, 0

System.Net.Sockets Verbose: 0 : [5816] 00000050 : 35 20 4D 61 79 20 32 30-30 36 20 32 31 3A 34 30 : 5 May 2006 21:40

System.Net.Sockets Verbose: 0 : [5816] 00000060 : 3A 31 39 20 47 4D 54 0D-0A 43 6F 6E 6E 65 63 74 : :19 GMT..Connect

System.Net.Sockets Verbose: 0 : [5816] 00000070 : 69 6F 6E 3A 20 63 6C

6F-73 65 0D 0A 0D 0A : ion:

close....

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Receive() -> 126#126

System.Net Information: 0 : [5816] Connection#42991209 - Received

status line: Version=1.1, StatusCode=505, StatusDescription=HTTP

Version Not Supported.

System.Net Information: 0 : [5816] Connection#42991209 - Received headers

{

Connection: close

Date: Fri, 05 May 2006 21:40:19 GMT

Server: Apache-Coyote/1.1

}.

System.Net Information: 0 : [5816] ConnectStream#1994618::ConnectStream(Buffered -1 bytes.)

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with ConnectStream#1994618

System.Net Information: 0 : [5816] Associating HttpWebRequest#58222774 with HttpWebResponse#57843929

System.Net Verbose: 0 : [5816] ConnectStream#1994618::Read()

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Receive()

System.Net.Sockets Verbose: 0 : [5816] Data from Socket#38785534::Receive

System.Net.Sockets Verbose: 0 : [5816] 00000000

:

:

System.Net.Sockets Verbose: 0 : [5816] Exiting Socket#38785534::Receive() -> 0#0

System.Net.Sockets Verbose: 0 : [5816] Socket#38785534::Dispose()

System.Net Verbose: 0 : [5816] Exiting ConnectStream#1994618::Read() -> 0#0

System.Net Error: 0 : [5816] Exception in the

HttpWebRequest#58222774::EndGetResponse - The remote server returned an

error: (505) Http Version Not Supported.

System.Net Verbose: 0 : [5816] HttpWebResponse#57843929::GetResponseStream()

System.Net Information: 0 : [5816] ContentLength=-1

System.Net Verbose: 0 : [5816] Exiting

HttpWebResponse#57843929::GetResponseStream() ->

SyncMemoryStream#66861212

AllenJunior at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 3
Looking at your trace it looks like there is a problem with the server you are using. There is nothing odd in the behavior of the client app and the error code sent back by the server makes no sense at all because it is complaining about the HTTP version being used even though the client and server used 1.1 the whole time. I would try to enable logging on the server side to see if any error code or message is available in conjunction with this failure.
JonCole at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 4

Its a tomcat 'bug'. Well they say its not a bug, its just correctly implementing the standard.

Try using HTTP 1.0 instead of 1.1

JonXXX at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 5

I've run into this and it's a bug in Tomcat, although they don't agree, and the bug in their system appears dead.

In order to avoid request/reply deadlocks, http clients can't wait "forever" to get a 100-Continue or 4xx message back when they use Expect: 100-Continue header, so at some point they must preemptively send the request body even if the server has not yet responded to the expectation. This case is covered in the HTTP/1.1 (RFC 2616) specification in section 8.2.3:

Because of the presence of older implementations, the protocol allows
ambiguous situations in which a client may send "Expect: 100-
continue" without receiving either a 417 (Expectation Failed) status
or a 100 (Continue) status. Therefore, when a client sends this
header field to an origin server (possibly via a proxy) from which it
has never seen a 100 (Continue) status, the client SHOULD NOT wait
for an indefinite period before sending the request body.

So how long should a client wait before it deems that it has "never seen the response"? No answer in the spec, as it obviously depends upon how long it takes the server to respond. ;-) Unless the client "knows" that 100-Continue or 4xx is definitely coming back, it can't wait forever. So any rational client implementation must pre-emptively post the body at some point (duration undefined), and therefore any rational HTTP/1.1 server implementation must deal with this possibility, for example by reading and disregarding the request body even after a 4xx response, or using a Connection: close on a 4xx response, or whatever. Tomcat doesn't do that, and tries to read the request body of the previous request as a new one, and poof, the error.

I would mention that going to HTTP/1.0 stinks for obvious perf reasons. Setting the ServicePointManager.Expect100Continue=false is probably a better choice.

stevebio at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified