Last-modified: 2004-05-10 (月) 04:01:06 (7284d)

 Axis1.1のHTTP Protocol Logを見てもわかるように、Axis1.1のHTTPレスポンスのHTTP HeaderにはContent-Lengthが付いていません。これがたまに問題になることがあるようです。

HTTPの規約では?

 RFC2068の4.4項には、HTTP message-bodyの長さの決定方法が記載されています。

  1. message-bodyを含んではいけない全てのレスポンスメッセージの場合
  2. Transfer-Encoding: chunked が適応されている場合
  3. Content-Length: が設定されている場合
  4. メディアタイプが "multipart/byteranges"の場合
  5. 接続を閉じるサーバによる場合

で、Axisのレスポンスは

HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Date: Sun, 04 Jan 2004 16:11:01 GMT
Server: Apache-Coyote/1.1
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <helloWorldReturn xmlns="http://test">こんにちは、世界</helloWorldReturn>
 </soapenv:Body>
</soapenv:Envelope>

ってことで、Keep-Aliveを終了する

Connection: close

の部分が、5番に対応するのかしら? とにかくどうして「Context-Length」かもしくは「Transfer-Encoding: chunked」が設定されていないのかしら?お行儀悪い。

Axisの開発者はどう考えてるの?

 AxisServletの1005行目ぐらいには、

/* My understand of Content-Length
 * HTTP 1.0
 *   -Required for requests, but optional for responses.
 * HTTP 1.1
 *  - Either Content-Length or HTTP Chunking is required.
 *   Most servlet engines will do chunking if content-length is not specified.
 */

//if(clientVersion == HTTPConstants.HEADER_PROTOCOL_V10) //do chunking if necessary.
//     res.setContentLength(responseMsg.getContentLength());

な~んて記述がありますね。「ほとんどのServletエンジンはContent-lengthが指定されてなければ、chunkするでしょ」ということでしょうか?
 で、そうしないようなHTTP関連アプリやProxyサーバなどで問題が発生しているわけですね。


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS