How to read eBay Response

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jaiswarvipin
Forum Commoner
Posts: 32
Joined: Sat Sep 12, 2009 3:43 pm
Location: India

How to read eBay Response

Post 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.
jaiswarvipin
Forum Commoner
Posts: 32
Joined: Sat Sep 12, 2009 3:43 pm
Location: India

Re: How to read eBay Response

Post 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.
Post Reply