3
我有一些大整數值和PHP SoapClient類的麻煩。看起來SoapClient無法處理大的數值 - 而且即使SOAP參數類型爲「xsd:long」,我也無法發送大於PHP_INT_MAX(2147483647)的數字。PHP SoapClient - 長整型SOAP請求
這是SOAP方法的WSDL規範我需要調用:
<message name="doFinishItemRequest">
<part name="session-handle" type="xsd:string"/>
<part name="finish-item-id" type="xsd:long"/>
<part name="finish-cancel-all-bids" type="xsd:int"/>
<part name="finish-cancel-reason" type="xsd:string"/>
</message>
的finish-item-id
值是"3599569593
「(從MySQL的BIG INT型加載字符串),但它似乎SoapClient的是鑄造。它以32位整數
SOAP信封看起來是這樣的:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:AllegroWebApi" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:doFinishItem>
<session-handle xsi:type="xsd:string">8a5d261806a4b60a283dabdb092e061a2d46e5d80bcc68bb00_56</session-handle>
<finish-item-id xsi:type="xsd:long">2147483647</finish-item-id>
<finish-cancel-all-bids xsi:type="xsd:int">0</finish-cancel-all-bids>
<finish-cancel-reason xsi:type="xsd:string"></finish-cancel-reason>
</ns1:doFinishItem>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
它改變3599569593 2147483647 SOAP服務告訴我,我傳遞了錯誤的ID。
是否有解決方法? (我無法更改WSDL。)
即使在64位系統上,PHP Soap擴展也只用於支持32位整數。這可能仍然是這樣。 – AbraCadaver
在Win7 + PHP5.5上爲我工作。謝謝! – Alex