note 92828 deleted from soapclient.soapcall by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 11:15:34 +0000 |
| Subject: | note 92828 deleted from soapclient.soapcall by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197045@lists.php.net to get a copy of this message | ||
Note Submitter: jarrod at squarecrow dot com
----
When dealing with .NET web services, its a good to remember that moving data back and forth between
PHP and .NET can be a little cumbersome if you aren't familiar with the object structures of
both.
.NET will return everything inside of an object - usually your function name with "Result"
tagged onto the end.
Example.
<?php
$client = new soapclient(SOAP_ADDRESS);
$objectresult = $client->GetDataByID(array('PeopleVendorsID'=> 'N21248'));
?>
.... where GetDataByID is my .NET web service function, PeopleVendorsID is name of the parameter I
pass it, and "N21248" happens to be the value of the parameter.
.NET was supposed to return an array to $objectresult but instead I found myself with a
triple-nested object.
Basically, if you ever find yourself in a situation where you can't seem to access your data,
make use of var_dump.
<?php
var_dump($objectresult);
?>
This will print out a very handy array/object structure for you to sift through - invaluable if
you're dealing with cryptic results from .NET.