我无法找出问题所在,我准备了一个XML,用于通过SOAP客户端发送,如下所示:
$client = new SoapClient($url, array(
'trace' => true,
"style" => SOAP_RPC,
"use" => SOAP_ENCODED
));
$response = $client->sendItems($xml);
var_dump($client->__getLastRequest());
var_dump
向我显示string(233) " "
,但是当我通过PHPStorm Rest客户端测试工具对其进行测试时,它会向我显示:
string(233) "<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://externalsite.com/ltm/"><SOAP-ENV:Body><ns1:sendItemsRequest/></SOAP-ENV:Body></SOAP-ENV:Envelope>
"
身体内没有任何内容。我三重检查了我的$xml
包含带有bodycontent的完整XML。
任何人之前都有类似的问题或者知道发生了什么?
====更新====
以下是XML内容:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ltm="http://externalsite.com/ltm/">
<soapenv:Header/>
<soapenv:Body>
<ltm:sendItemsRequest>
<ItemsToAdd>
<ItemToAdd>
<description>DEMO DESCRIPTION text</description>
<url>http://localhost/media/items/0000000001.jpg</url>
<brand>BRANDTEST</brand>
<status>creation</status>
<statusDate>1423209737</statusDate>
<beginDate>1406844000</beginDate>
<endDate>1730329200</endDate>
<targets>
<barcode>1234567891011</barcode>
<barcode>9876543210123</barcode>
</targets>
<medias>
<media>
<retailer>RETAILERTEST</retailer>
<format>dummyformat</format>
</media>
</medias>
</ItemToAdd>
</ItemsToAdd>
</ltm:sendItemsRequest>
</soapenv:Body>