Ric*_*vet 8 php pdf web-services nusoap
我创建了一个函数来调用Web服务来获取pdf文件的内容.网络服务很好用.
我想当文件太大时会出现问题.
我可以在另一个有相同错误的服务器上修复同样的问题抛出memory_limit并且他的php版本是5.4.Nusoap版本是0.9.5,我通过作曲家的捆绑使用它.
这个包来自https://packagist.org/packages/econea/nusoap我正在使用v0.9.6.
在我无法修复错误的服务器中,我使用的是php 7.0.Nusoap版本在此服务器中也是0.9.5.
/**
* @param string $docId
* @return string
*/
public function getDocumentFromDocId(string $docId)
{
$client = new \nusoap_client('http://'.$this->ip.'/arcdoc/WebServiceServer.php?wsdl', true);
$response = $client->call('GetDoc', array(
'xxxx1' => 'xxxxxx',
'xxxx2' => base64_encode('xxxxx'),
'xxxx3' => base64_encode("yyyyyyy"),
'xxxx4' => base64_encode($docId)
));
var_dump($response);
return $response;
}
Run Code Online (Sandbox Code Playgroud)
当我var_dump()的内容回复此回复时:
/var/www/html/project/src/AppBundle/Service/whatever.php:55:boolean false
Run Code Online (Sandbox Code Playgroud)
如果文件大于6-8M则为false $response但是如果文件小于6-8M则不成问题.
所以,我可以说webservice在大小小于6-8M的文件中运行良好.
知道为什么我没有得到答案吗?
我正在测试将相同的pdf从中减少9M到6M并且效果很好,因此它必须与文件的大小有关.在我的情况下似乎开始工作不好7-9M.
$paramWSDLS = array(
'soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-15',
'cache_wsdl' => WSDL_CACHE_NONE,
'exceptions' => false,
'trace' => true,
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL
);
$wsclient = new SoapClient('http://'.$this->ip.'/arcdoc/WebServiceServer.php?wsdl', $paramWSDLS );
$parametros = array(
'xxxx' => 'xxxxxx',
'xxxx2' => base64_encode('xxxxx2'),
'xxxx3' => utf8_decode('xxxxx3'),
'xxxx4' => utf8_decode('xxxxx4'),
'showMask' => false
);
$response = $wsclient->__soapCall('GetDoc', $parametros );
Run Code Online (Sandbox Code Playgroud)
不知道为什么,但使用这个 SoapClient 解决了这个问题。
| 归档时间: |
|
| 查看次数: |
159 次 |
| 最近记录: |