2012-01-12 30 views
4

任何人都可以請解釋如何在php中使用soapvar指定任何類型參數的類型?如何爲xsd創建soapvar對象:anyType

<complexType name="Entry"> 
      <sequence> 
       <element name="key" nillable="true" type="xsd:anyType" minOccurs="0" /> 
       <element name="value" nillable="true" type="xsd:anyType" minOccurs="0" /> 
      </sequence> 
     </complexType> 

例如:

$arr=array('key'=>new SoapVar('EMAIL_ADDRESS',SOAP_ENC_OBJECT,'xsd:anyType'),'value'=>new SoapVar('[email protected]',SOAP_ENC_OBJECT,'xsd:anyType')); 

當通過上述陣列USERPROFILE寄存器用戶沿着在SoapClient的SDK的Yodlee它返回 「未知」 的異常。

+0

有在上面的代碼中有語法錯誤(最後缺少引用) - 這可能與問題有關,或者它只是創建問題時的複製/粘貼錯誤? – DaveRandom 2012-01-12 09:57:43

+0

謝謝戴夫,我糾正了以上問題,請現在檢查並回復您的想法 – 2012-01-12 10:34:45

回答

5

海我終於找到了我的問題,它的基礎上的命名空間URL的問題,我用這個

$arr=array('key'=>new SoapVar('EMAIL_ADDRESS',XSD_ANYTYPE,'string','http://www.w3.org/2001/XMLSchema','key'),'value'=>new SoapVar('[email protected]',XSD_ANYTYPE,'string','http://www.w3.org/2001/XMLSchema','value')); 

,並得到了Yodlee公司服務器感謝解決所有