問題描述
我是從 Soap 客戶端請求中得到的:
I got this from a Soap client request:
異常:SoapFault 異常:[soap:Client] 服務器無法讀取請求.---> 有錯誤在 XML 文檔中 (2, 273).---> 該字符串 '2010-5-24' 無效AllXsd 值.在/path/filinet.php:21堆棧跟蹤:#0 [內部函數]:SoapClient->__call('SubIdDetailsByO...',數組) #1/path/filinet.php(21):SoapClient->SubIdDetailsByOfferId(Array) #2 {main}
Exception: SoapFault exception: [soap:Client] Server was unable to read request. ---> There is an error in XML document (2, 273). ---> The string '2010-5-24' is not a valid AllXsd value. in /path/filinet.php:21 Stack trace: #0 [internal function]: SoapClient->__call('SubIdDetailsByO...', Array) #1 /path/filinet.php(21): SoapClient->SubIdDetailsByOfferId(Array) #2 {main}
好像我發送的值不正確,如何在 php 的 AllXsd 中格式化我的值?
Seems like I am sending an incorrect value, how do I format my value in an AllXsd in php?
這是我的代碼:
<?php
$start = isset($_GET['start']) ? $_GET['start'] : date("Y-m-d");
$end = isset($_GET['end']) ? $_GET['end'] : date("Y-m-d");
//define parameter array
$param = array('userName'=>'user', 'password'=>'pass', 'startDate' => $start, 'endDate' => $end, 'promotionId' => '');
//Get wsdl path
$serverPath = "https://webservices.filinet.com/affiliate/reports.asmx?WSDL";
//Declare Soap client
$client = new SoapClient($serverPath);
try {
//make the call
$result = $client->SubIdDetailsByOfferId($param);
//If error found display error
if(isset($fault))
{
echo "Error: ". $fault;
}
//If no error display response
else
{
//Used to display raw XML in the Web Browser
header("Content-Type: text/xml;");
//SubIdDetailsResult = XML results
echo $result->SubIdDetailsByOfferIdResult;
}
}
catch(SoapFault $ex) {
echo "<b>Exception:</b> ". $ex;
}
unset($client);
?>
推薦答案
AllXsd 值看起來像這個 IIRC
AllXsd values look something like this IIRC
2010-05-24T18:13:00
2010-05-24T18:13:00
這篇關于不是有效的 AllXsd 值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!