我创建了一个这样的数组
"AnonymousTraveler"=>array(
"ObjectKey" => "PAX1",
"PTC"=>array(
"_" => 'ADT',
"Quantity" => "1"
),
)
我的XML必须像这样
<AnonymousTraveler ObjectKey="PAX1">
<PTC Quantity="1">ADT</PTC>
</AnonymousTraveler>
在调用soap之前,我需要检查XML格式。所以我创建了这样的格式
class DummySoapClient extends SoapClient {
function __construct($wsdl, $options) {
parent::__construct($wsdl, $options);
}
function __doRequest($request, $location, $action, $version, $one_way = 0) {
print_r($request)."<br>";
exit;
return $request;
}
}
$client = new DummySoapClient($wsdl,array("exceptions" => 0
,'soap_version' => SOAP_1_1
,"cache_wsdl" => WSDL_CACHE_NONE
, 'trace' => true
,"features" => SOAP_SINGLE_ELEMENT_ARRAYS));
我的问题现在不是__doRequest ..我不是没有问题。任何人都可以为此提供一些解决方案。谢谢你的进步。