title: How to avoid "505: HTTP Version not supported" error?
body: <p>I am trying to use the Bing SOAP API for a simple search request. But now that I finally figured out how to send the request using JAX-WS, I am stuck again. I get the reply 
  <code>com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 505: HTTP Version not supported</code> when I send the request. Can anyone help me out?</p>
  
  <p>I am using dynamic invocation with JAX-WS 2.0, if that makes any difference.</p>
  
  <pre><code>Dispatch&lt;SOAPMessage&gt; dispatch = service.createDispatch(
      portName, SOAPMessage.class, Service.Mode.MESSAGE);
  MessageFactory messageFactory = ((SOAPBinding) dispatch.getBinding())
      .getMessageFactory();
  SOAPMessage request = messageFactory.createMessage();
  // Add content to the request
  SOAPMessage response = dispatch.invoke(request);
  </code></pre>
  
  <p>Wireshark tells me, that the request header contains <code>POST /soap.asmx HTTP/1.1</code> and the reply comes back also with an HTTP/1.1 versioning. Doesn't this mean, it's alright?</p>
  
  <p>Thanks, moxn</p>
  
  <p><strong>UPDATE</strong>:
  It's not a JAX-WS specific error. I implemented the communication via Commons HTTPClient and still get the same 505.</p>
  
  <p>Following the headers from the HTTPClient request:</p>
  
  <pre><code>Content-Length: 435
  Content-Type: text/xml
  Host: api.bing.net:80
  Connection: Keep-Alive
  User-Agent: Apache-HttpClient/4.0.1 (java 1.5)
  Expect: 100-Continue
  </code></pre>
  
  <p><strong>UPDATE</strong>: 
  It also doesn't work with HTTP/1.0 btw...</p>