我有一個問題,在php中傳遞一個物件引數。 也許你能幫助我。
我想使用getBookingPairsByPersonID方法
。在Wsdl中是這樣的:
<xsd:element name="getBookingPairsByPersonID"/span> type="tns:getBookingPairsByPersonID"/span>/>
<xsd:complexType name="getBookingPairsByPersonID"/span>>
<xsd:序列>
<xsd:元素 minOccurs="0" name="arg0" nillable="true" type="xsd:string"/>
<xsd:元素 name="arg1" nillable="true" type="tns:ArrayOfString"/>
<xsd:元素minOccurs="0" name="arg2" type="ns0:WSTimestamp"/>
<xsd:元素 minOccurs="0" name="arg3" type="ns0:WSTimestamp"/>
<xsd:元素 name="arg4" type="xsd:boolean"/>
<xsd:元素 name="arg5" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
這就是檔案中所說的
java.util.List<WSBookingPair> getBookingPairsByPersonID(java.lang.String session,
java.lang.String[] personIDs。
WSTimestamp from,
WSTimestamp to,
boolean checked,
int type)
我的PHP代碼:
$wsID = array ('1063') 。
$wsInt = 1;
$wschecked = false;
$wsFrom ='28.07.2021 00:00:00'/span>。
$wsTo ='28.07.2021 23:59:59';
$wsBooking = $client->getBookingPairsByPersonID(array('arg0'/span> => $session->回傳,'arg1' =>。array('ArrayOfString' => $wsID) , 'arg2' => $wsFrom , 'arg3' => $wsTo, 'arg4' => $wschecked, 'arg5'=> $wsInt)。)
var_dump($wsBooking-> return)。
echo var_dump($client->__getLastRequest()) 。
輸出:
object(stdClass)[21] null
WSTimestamp的結構是這樣的:
輸入:$wsTsNow = $client->getTime(array('arg0' => $session->return));
輸出:
object(stdClass) [5]
public 'return' =>
object(stdClass) [6]
public 'TS' => int 1627977040077]
public 'day => int 3
public 'hour => int 9
public 'min => int 50
public 'month => int 8
public 'sec=> int 40
public 'timeInSeconds' => int 1627977040
public 'timestamp' => string '03.08.2021 09:50:40' (length=19)。
public 'year' => int 2021
我試著在事后創建一個物件,但也沒有成功
class WSTimestamp{
public $timestamp;
}
$wsFrom = new WSTimestamp()。
$wsFrom->timestamp = "28.07.2021 00:00:00"/span>。
$wsTo = new WSTimestamp()。
$wsto->timestamp = "28.07.2021 23:59:59"/span>。
我不明白的是,下面的方法是有效的
。描述:
getLevelsEByIdentification
java.util.List<WSExtensibleLevel> getLevelsEByIdentification(java.lang.String session,
WSLevelIdentification[] ids,
WSTimestamp Timestamp)
代碼:
$wsTsNow = $client-> getTime(array('arg0' => $session-> return))。
$wsLevelIdentArray = array('levelID'/span> => 1, 'code' => '17022')。)
$wsLevelEArray = $client-> getLevelsEByIdentification(array('arg0' => $session-> return, 'arg1' => array('WSLevelIdentification' => $wsLevelIdentArray), 'arg2' => $wsTsNow))。
如何正確傳遞物件引數?
uj5u.com熱心網友回復:
現在可以了:
輸入:
輸入:
$wsInt = 2;
$wschecked = false;
$wsID = array ("9999"/span>);
class WSTimestamp{
public $timestamp;
}
$wsFrom = new WSTimestamp()。
$wsFrom->timestamp = "09.07.2021 00:00:00"/span>。
$wsTo = new WSTimestamp()。
$wsTo->timestamp = "09.07.2021 23:59:59"/span>。
$wsBooking = $client->getBookingPairsByPersonID(array('arg0'/span> => $session->回傳,'arg1' => $wsID ,'arg2' => $wsFrom , 'arg3' => $wsTo, 'arg4' => $wschecked, 'arg5'=> $wsInt)。)
var_dump($wsBooking-> return->WSBookingPair)。
輸出:
object(stdClass) [20]
public 'absence' => boolean falsepublic 'checked' => boolean false
public 'complete' => boolean true
public 'duration' => int 0
public 'from' =>
object(stdClass) [21]
public 'TS' => int 1625828040000]
public 'day => int 9
public 'hour => int 12
public 'min => int 54
public 'month => int 7
public 'sec => int 0
public 'timeInSeconds' => int 1625828040
public 'timestamp' => string '09.07.2021 12:54:00' (length=19)
public 'year' => int 2021 >。
public 'fromBookingID' => int 1905
public 'fullDay' => boolean false
public 'level =>
object(stdClass) [22]
public 'notice' => string '' (length=0)
public 'person' => string '99999' (length=4)
public 'properties' => null
public 'to' =>
object(stdClass) [23]
public 'TS' => int 1625828040000
public 'day => int 9
public 'hour => int 12
public 'min => int 54
public 'month => int 7
public 'sec => int 0
public 'timeInSeconds' => int 1625828040
public 'timestamp' => string '09.07.2021 12:54:00' (length=19)
public 'year' => int 2021 >。
public 'toBookingID' => int 1906
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/312429.html
標籤:
上一篇:8080埠已被使用
下一篇:Unity,C#-使用滑鼠的指標
