Page 1 of 1

How to read eBay Response

Posted: Sat Oct 03, 2009 4:24 am
by jaiswarvipin
Hi All,
I am working on the eBay API and i am using SOAP communication. After API eBay API communication it return the response in below format.

Code: Select all

 
SoapFault Object
(
    [message:protected] => Not Found
    [string:private] => 
   

Code: Select all

=> 0
    [file:protected] => /home/djprice/public_html/ebay/___index.php
    [line:protected] => 23
    [trace:private] => Array
        (
            [0] => Array
                (
                    [function] => __doRequest
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 
disco light
 
                            [1] => http://open.api.ebay.com/shopping
                            [2] => 
                            [3] => 1
                            [4] => 0
                        )
 
                )
 
            [1] => Array
                (
                    [function] => __call
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                        (
                            [0] => FindItems
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [QueryKeywords] => disco light
                                        )
 
                                )
 
                        )
 
                )
 
            [2] => Array
                (
                    [file] => /home/djprice/public_html/ebay/___index.php
                    [line] => 23
                    [function] => FindItems
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [QueryKeywords] => disco light
                                )
 
                        )
 
                )
 
        )
 
    [faultstring] => Not Found
    [faultcode] => HTTP
)
 
I really don’t know that how to read this response this response it self a class and it contains the array.
I want to read each and every value. Can any one help on this ASAP.

Thanks & Regards
Jaiswar Vipin Kumar R.

Re: How to read eBay Response

Posted: Mon Oct 05, 2009 12:06 pm
by jaiswarvipin
Pleae refer the bwlo code to acces the value from above object array.

Like if you want to access the "trace" value for error monotring then

Consider this return value stored in the "$_SoapResponse" variable.

Code: Select all

 
foreach($_SoapResponse->trace as $errorItem)
{
echo $errorItem->function;
echo $errorItem->class;
print_r( $errorItem->args);
}
 
Thanks for not replay, just becuase i come to know that how to process the this type of response.