且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SOAP Web 服务是否仅支持“POST"?http方法

更新时间:2022-03-14 05:44:45

我一直使用 POST 但根据 W3C 标准,SOAP 支持 POST 和 GET 方法.

I always used POST but according to the W3C standard, SOAP supports both POST and GET methods.

经过一些研究,这似乎并不完全正确,如您所见here一>.理论上可以使用 GET,因为 POST 和 GET 是 HTTP 传输协议的方法,而 SOAP 可以通过 HTTP 使用.

After some research, it seems that it's not completely true, as you can see here. It is theoretically possible to use GET because POST and GET are methods of HTTP transport protocol and SOAP can be used over HTTP.

但如您所知,GET 将请求包含在查询字符串中.SOAP 请求(XML 消息)通常过于复杂和冗长,无法包含在查询字符串中,因此几乎每个实现(例如 JAX-WS)都只支持 POST.

But as you know, GET includes the request in the query string. SOAP requests (XML messages) are usually too complex and verbose to be included in the query string, so almost every implementation (for example JAX-WS) supports only POST.