问题描述
我在一项服务中就已经遇到了这个问题好几天了,当我在WCF测试客户端中进行测试时,该服务就像一个魅力一样工作,但是在一项特定服务中,我必须像这样发送Null参数
<statusFilter i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
但是当我通过soapclient用PHP发送这个消息时,我得到一个空值错误
Fatal error: Uncaught SoapFault
exception: [s:WebServicesErrorArgumentEmptyOrMissing] One of the parameters of the request was empty or missing.
in C:\xampp\htdocs\soap\attrib_event.PHP:55
Stack trace:
#0 C:\xampp\htdocs\soap\attrib_event.PHP(55): SoapClient->__call('QueryResults',Array)
#1 {main} thrown in C:\xampp\htdocs\soap\attrib_event.PHP on line 55
我的代码是这个
<?PHP
$soapclient = new SoapClient("http://clvmweb.clyfsa.com:81/SEP2WebServices/DataService.svc?singleWsdl");
$xml = '';
$xml= is_null($xml);
$params = array (
'QueryResults' =>
array (
'measurementPointResultTypes' =>
array (
'MeasurementPointResultTypeReferences' =>
array (
'MeasurementPointName' => '30300050','MeasurementPointId' =>
array (
'@value' => '','@attributes' =>
array (
'nil' => 'true',),'AgencyId' => '0','ResultTypeNames' =>
array (
'd6p1:string' => 'ActivePowerComb(|+A|+|-A|)_INST_LP1','intervalStart' => '2020-10-03T10:38:00','intervalEnd' => '2020-11-03T13:38:00','statusFilter' =>
array (
'@value' => '','@attributes' =>
array (
'i:nil'=>"true",'nil' => "true",'sourceFilter' =>
array (
'Measured' => 'true','Manual' => 'false','Aggregated' => 'false','Imported' => 'false','Estimated' => 'false','resultOrigin' => 'PreferRaw','lastResultOnly' => 'true',);
$response = $soapclient->QueryResults($params);
$array = json_decode(json_encode($response),true);
echo '<pre>'; print_r($params); echo '</pre>';
var_dump($array);
?>
我已经使用PHP中的其他服务做到了这一点,但现在我被困住了。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)