php Soap 客户端:wsdl 与非 wsdl - 哪个更快?
我正在使用 PHP 5 和内置的 SoapClient。
对于 PHP Soap 支持的开发人员来说,这确实是一个问题。
SoapClient 为您提供了 2 个选择:WSDL 模式(在本地缓存 WSDL 文件)和非 WSDL(需要您构建自己的请求)。
使用WSDL显然更方便。 但是,我想知道每次创建 SoapClient 实例时会进行多少处理。 WSDL 已缓存,但每次创建 SoapClient 时是否都必须重新处理整个 WSDL? 如果是这样,那么走非 WSDL 路线似乎可能更有效(从 CPU 角度来看)。
在我的情况下创建非 WSDL SoapClient 没有问题。 我是不是该?
I'm Using PHP 5 and the built-in SoapClient.
This is really a question for the developers of PHP Soap support.
The SoapClient gives you 2 choices: WSDL mode, which caches the WSDL file locally, and non-WSDL which requires you to build your own requests.
Using the WSDL is obviously more convenient. But, I wonder how much processing this does each time you create a SoapClient instance. The WSDL is cached, but does it have to re-process the entire WSDL each time you create a SoapClient? If so, it seems it might be more efficient (CPU-wise) to go the non-WSDL route.
It's no problem to create the non-WSDL SoapClient in my situation. Should I?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们需要足够的时间来构建缓存(所以很痛苦)。 我想真正的问题是该缓存何时过期(在脚本退出时?)以及您进行了多少次调用(每个脚本?)。
另外,听起来您正在尝试过早地优化某些内容。 如果不是问题就不用担心。 你可能会把时间花在一些无关紧要的事情上。
It takes enough time for them to build in a cache (so its painful). I guess the real question is when does that cache expire (on script exit?) and how many calls are you making (per script?).
Also it sounds like you're trying to prematurely optimize something. If its not a problem don't worry about it. You could spend up time on something that doesn't matter.