如何确定 SOAP 消息的最大大小? [英] How is the max size of a SOAP message determined?

查看:33
本文介绍了如何确定 SOAP 消息的最大大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 PHP 5.2.6 上使用 NuSOAP,我看到最大消息大小只有 1000 字节(这使得做任何有意义的事情变得很困难).这是在端点的 WSDL 中设置的还是我可以在 NuSOAP 中配置的内容?

I'm using NuSOAP on PHP 5.2.6 and I'm seeing that the max message size is only 1000 bytes (which makes it tough to do anything meaningful). Is this set in the endpoint's WSDL or is this something I can configure in NuSOAP?

推荐答案

关于 FUD 关于1000 字节限制"...我查了 nusoap_client 源代码,发现限制只对 debug 输出有效.

Regarding the FUD about a "1000 bytes limit"... I looked up the nusoap_client sourcecode and found that the limit is only effective for debug output.

这意味着所有数据都被处理并传递给网络服务(无论其大小),但调试日志中只显示前 1000 个字节(或更准确地说:字符).

This means all data is processed and passed on to the webservice (regardless of its size), but only the first 1000 bytes (or more precisely: characters) are shown in the debug log.

代码如下:

$this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000));

// send
$return = $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout);

如您所见,getHTTPBody() 调用使用了整个 $soapmsg,并且只有调试输出仅限于前 1000 个字符.如果您想更改此设置,只需更改 substr() 调用以满足您的需要,或者简单地将其替换为 $soapmsg(因此所有内容都显示在调试中输出也是).

As you can clearly see, the getHTTPBody() call uses the whole $soapmsg, and only the debug output is limited to the first 1000 characters. If you'd like to change this, just change the substr() call to fit your needs, or simply replace it by $soapmsg (so everything is shown in the debug output, too).

这应该与实际发送的数据的任何实际限制完全无关.当然可能还有其他因素实际上限制了您可以发送的内容的大小(例如,为您的 PHP 脚本设置的 RAM 限制、您的 HTTP 实现的限制或可用的虚拟内存用完),但是理所当然地没有例如,您可以使用 NuSOAP 发送的数据的1000 字节限制".

This should have absolutely nothing to do with any real limit on the data actually sent. There could of course be other factors actually limiting the size of what you can send (e. g. the RAM limit set for your PHP script, limitations of your HTTP implementation, or running out of available virtual memory), but take it for granted there is no such thing as a "1000 bytes limit" for the data you can send with NuSOAP.

这篇关于如何确定 SOAP 消息的最大大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆