我這怎麼能轉換爲CF轉換(陣列())到CF
$client = array(array("apPat" => 'Estrada', "apMat" => 'Castillo'));
我需要這個對象從CF發送到web服務網,但web服務不接受它。
我試圖
<cfset client = arraynew[]>
<cfset client[1] = structnew()>
<cfset client[1].apPat = "Estrada">
<cfset client[1].apMat = "Castillo">
這是我真正的代碼
<cfset arrAgente[1] = {}>
<cfset arrAgente[1].ramoTecnico = "1">
<cfset arrAgente[1].codAgente = "5095">
<cfset emissionRequest = {}>
<cfset emissionRequest.ramoTecnico = "1">
<cfset emissionRequest.codAgente = "5095">
<cfset emissionRequest.poliza = {}>
<cfset emissionRequest.poliza.codTipoPoliza = "2">
<cfset emissionRequest.poliza.ramoComercial = "5">
<!--- here is where I have problems beacuse I need to send an array or a list. The above code I dont have problems, the Net recognize it like a single array the structures----->
<cfset emissionRequest.agente = #arrAgente#>
您需要提供更多的信息。 「WS不接受」是什麼意思?錯誤嗎?錯誤是什麼?關於WS似乎不喜歡的數據結構是什麼?我們不是,恐怕是心靈感應:您需要向我們提供所有必要的信息以幫助您。建議閱讀:http://cfmlblog.adamcameron.me/2013/09/short-self-contained-correct-compilable.html –
''是無效的CFML。它應該是''或''......記住@ AdamCameron指出'client'用作範圍 –
duncan
Heh,好點,Dunc 。 –