SOAP and Arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am using the SOAP Package and have an issue.



When I pass an array to the SOAP call it wraps each item in an <item> 
</item> tag. The WSDL indicated it needs to be wrapped in <int> </int> but 
it doesn't do this.



I created a new array w/ the int as the array identifier and it now created 
the <int></int> but still warps in an <item> tag.



The Lib works great for everything except Arrays. All of my array values get 
wrapped in this <item> tag and the Soap server ignores them.



The Documentation is lacking on this issue.



Is this a Bug or am I not submitting the array correctly. It does parse 
arrays that are multi level correctly after the first level.



Example is the $Cust array, The whole Array is wrapped in <item> tags but 
the data inside creates the correct tags.



Below is some example code of the calls I am making.



Please provide some guidance.





foreach ($PublicationID as $Pub)

{

                $PubID[] = array("int" => intval($Pub));

}





foreach ($CustomFld as $Key => $Data)

{



                $Cust[] = array("CustomField" => array("FieldName" => $Data, 
"Value" => $CustomData[$Key]));



}





$wsdl_url = "http://api.emaildirect.com/v3/api.asmx?WSDL";;

$WSDL = new SOAP_WSDL($wsdl_url);

#Connect to remote API Server

$soap = $WSDL->getProxy();

#Send SOAP Request to server



$response = $soap->Email_ForceAddition($AccountName

                                                                             
                       , $APIPassword

                                                                             
                       , $Email

                                                                             
                       , $SourceID

                                                                             
                       , $PubID

                                                                             
                       , $LstID

                                                                             
                       , $AutoRespondID

                                                                             
                       , $Cust);





-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux