Skip to main content
Published: April 13 2008, 11:55:00 PMUpdated: November 28 2020, 4:10:55 PM

Details on how to troubleshoot the PHP 5 notification sample code.

To verify that you're subscribed to the proper events, it's  best to look at your NotificationPreferences on a user-level basis, so change this line in GetNotificationPreferences.php : 
      $params = array('Version' => 525, 'PreferenceLevel' => 'User');
to add the PreferenceLevel of User


Then you should get something like this :

stdClass Object (
[Timestamp] => 2008-04-01T23:29:41.993Z
[Ack] => Success
[Version] => 557
[Build] => e557_core_Bundled_6324270_R1
[UserDeliveryPreferenceArray] => stdClass Object (
[NotificationEnable] => Array (
[0] => stdClass Object (
[EventType] => EndOfAuction
[EventEnable] => Enable )
[1] => stdClass Object (
[EventType] => ItemRevised            <<----  Subscribe to ItemRevised
[EventEnable] => Enable )
[2] => stdClass Object (
[EventType] => CustomCode
[EventEnable] => Enable ) ) ) )


You may not be able to use the debugging "error_log()" messages in the original sample code because you may not have access to the Apache error log.  To get debugging information in this case, where needed, change the error_log statements to log to an accessible file rather than the Apache error log :

  error_log("This writes to a file", 3, "/var/tmp/my-errors.log");


Also, in eBaySOAP.php, class eBayPlatformNotifications, set debug to be true by default, at least for now :
       public function __construct(eBaySession $session, $debug = true) {


For example, to the ItemRevised event.  You then will get output like this in your Apache error log :

[Tue Apr 01 19:25:30 2008] [error] [client 66.135.197.166] eBayPlatformNotificationListener: ItemRevised - ItemID : 110030062203

[Tue Apr 01 19:25:31 2008] [error] [client 66.135.197.166] <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header>  
<ebl:RequesterCredentials soapenv:mustUnderstand="0" xmlns:ns="urn:ebay:apis:eBLBaseComponents" xmlns:ebl="urn:ebay:apis:eBLBaseComponents">   
<ebl:NotificationSignature xmlns:ebl="urn:ebay:apis:eBLBaseComponents">hGenvEjExwfBBQOfd0TG5Q==</ebl:NotificationSignature>  
</ebl:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>  
<GetItemResponse xmlns="urn:ebay:apis:eBLBaseComponents">   
<Timestamp>2008-04-01T23:25:31.020Z</Timestamp>   
<Ack>Success</Ack>   
<CorrelationID>264993140</CorrelationID>   
<Version>557</Version>   
<Build>e557_core_Bundled_6324270_R1</Build>   
<NotificationEventName>ItemRevised</NotificationEventName>   
<RecipientUserID>my_seller_store</RecipientUserID>   
<Item>    
<AutoPay>false</AutoPay>    
<BuyerProtection>ItemIneligible</BuyerProtection>    
<BuyItNowPrice currencyID="USD">10.0</BuyItNowPrice>    
<Country>US...
...
</ShippingTermsInDescription>    
<PictureDetails>     
<GalleryType>None</GalleryType>     
<GalleryURL>http://thumbs.qa.ebaystatic.com/pict/41007087008080_0.jpg</GalleryURL>     
<PhotoDisplay>None</PhotoDisplay>     
<PictureURL>http://thumbs.qa.ebaystatic.com/pict/41007087008080_0.jpg</PictureURL>    
</PictureDetails>    
<ProxyItem>false</ProxyItem>   
</Item>  
</GetItemResponse>
</soapenv:Body></soapenv:Envelope>

[Tue Apr 01 19:25:31 2008] [error] [client 66.135.197.166] eBayPlatformNotificationListener: ItemRevised - ItemID : 110030062203


Note the first line comes from the "carp" method (modified to add a little more info).  The next entry is the actual SOAP body for a GetItem coming back.  This will have to be parsed to get the specific information you're looking for.  Finally comes a line with more output from the "carp" method.

So recommendations for troubleshooting the PHP 5 sample notification code are :

  • Modify GetNotificationPreferences.php so you can get user-level information on the events you're subscribed to.  Send this to me as needed.
  • Modify the error_log messages so you send output to an accessible file
  • Modify the carp and other debug methods so you can better see what's going on.
  • You may want to use the API Test Tool  to send in raw XML requests like Set/GetNotificationPreferences

How well did this answer your question?
Answers others found helpful