SOAP and Arrays

[email protected] ("Ross King")
Newsgroups php.soap
Message-ID <[email protected]>
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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.