又被SOAP坑了一天

來源:互聯網
上載者:User

=======

說明篇

=======

之前基於nusoap搭好的nginx+php的webservice服務(http://blog.csdn.net/linvo/article/details/9109963),在和java那邊調試的時候出錯

java那邊get wsdl時正常,post調用服務後報 “No namespace on "html" element” 錯誤,查了nginx log,發現nginx返回411錯誤

HTTP的411狀態具體就不多說了,這裡說下針對Nginx的情況:

nginx給出的官方解釋有三種情況會引發nginx彈411回去

1、client sent invalid “Content-Length” header

2、client sent … method without “Content-Length” header

3、client sent “Transfer-Encoding: chunked” header

感覺像是第二種,但是最後我的解決方案卻是:

為Nginx增加了HttpChunkinModule模組!

========

安裝篇

========

安裝前先看下當前Nginx的模組配置資訊(例如):

/usr/local/nginx/sbin/nginx -V

nginx version: nginx/1.0.15
TLS SNI support disabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

下載chunkin-nginx-module(https://github.com/agentzh/chunkin-nginx-module/tags)並解壓

重新編譯Nginx,configure增加參數 --add-module=/root/chunkin-nginx-module-0.23/  (視情況設定此處模組的源碼目錄)

make -j2

make install

Nginx設定檔server中增加如下參數:

        server {                chunkin on;                error_page 411 = @my_411_error;                location @my_411_error {                chunkin_resume;                }                ……

重啟Nginx,OK

----------------------------------- 我是分割線 --------------------------------------

相關連結:

http://blog.chinaunix.net/uid-16974460-id-296023.html

http://www.l99.com/1548156/blog/view/283241

http://wiki.nginx.org/HttpChunkinModule

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.