搜索 |
try {
$soapurl="URL地址?wsdl";
$client = new \SoapClient($soapurl);
$client->soap_defencoding = 'utf-8';
$client->xml_encoding = 'utf-8';
$xmldata='<?xml version="1.0" encoding="utf-8"?><file><archiveTypeId>文书档案</archiveTypeId> <titleProper>提名001</titleProper> <yearCode>2010</yearCode> <documents> <document> <titleProper>测试导入文件</titleProper> <url>http://192.168.3.8/d/file/2019-06-20/be34e45f7db6f37a404be796a6fd4819.pdf</url><path>be34e45f7db6f37a404be796a6fd4819.pdf</path></document> </documents> <processinfos> <processinfo><type>OA</type> <date>处理时间</date> <person>处理者</person> <dept>处理部门</dept> <info>处理意见</info> </processinfo> </processinfos> </file>';
$result = $client->__soapCall('importFile', array($xmldata));//可行了
// $result = $client->importFile($xmldata);//可行了
// dump($result);
$xml=simplexml_load_string($result);//xml格式化
dump($xml);
echo $xml->RETURN_STATUS;
// $res = $xml->children('http://schemas.xmlsoap.org/soap/envelope/')->children('http://192.168.3.30:8081/xxz/services/ImportService/');
// dump($res);
// print_r($client->__getTypes());
} catch (SOAPFault $e) {
print $e;
}