我正在尝试通过POST调用从具有身份验证的SOAP数据源中打印XML文件。这是我的代码,但是当我尝试访问文件时,我得到: string(2314)“ 。
$url = "http://example.com/get_pricelist_xml";
$xmlRequest = '<PRINT_PRICELIST_REQUEST>
<CUSTOMER_NUMBER>somecustomenumber</CUSTOMER_NUMBER>
<LOGIN>login</LOGIN>
<PASSWORD>mypassword</PASSWORD>
</PRINT_PRICELIST_REQUEST>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = curl_exec($ch);
我的var_dump给我这个:
string(2314) "
$errorDump Server error occurred
$errorInfo
$errorDump Server error occurred
$error [B2BSERV.0062.9001] Service record argument in RecordToDocument is null
$localizedError [B2BSERV.0062.9001] Service record argument in RecordToDocument is null
$errorType com.wm.util.LocalizedException
$service b2b.main:get_pricelist_xml
$user Default
$time 2019-06-23 20:28:48 CEST
$pipeline
addHeader false
start_time 1561314528495
80869750 86344 80869750
$name b2bpl
epochtime 1561314528495
$callStack
$service pub.web:recordToDocument
$currentPath
$service b2b.main:get_pricelist_xml
$currentPath /5
$error [B2BSERV.0062.9001] Service record argument in RecordToDocument is
null
$errorType com.wm.util.LocalizedException