Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Develop apps with Web services and the eBay SDK, Part 3: Develop eBay applications with PHP5 and Web services

Alex Garrett (ljagged@thinkpig.org), Senior Consultant, Isthmus Group, Inc.
After pursuing an undergraduate degree in classics, linguistics, computer science, psychology, and literature, Alex finally settled on a B.S. in philosophy from the University of Wisconsin. His professional career is as checkered as his academic one. He has been the e-commerce architect for a GE Capital company, a lecturer at a University of Wisconsin school, a systems administrator, an acquisitions editor for a small technical publishing company, and a code toad, among other things. Currently, he's a senior consultant with a Madison, WI-based firm and a proud new father.

Summary:  Create applications in PHP5 that interact with eBay through Web services. Almost half of eBay's transactions occur through its Web services platform. In this tutorial, you'll acquire a solid understanding of the mechanics of the eBay XML API and learn how to use the Services_Ebay PHP extension.

View more content in this series

Date:  08 Nov 2005
Level:  Intermediate PDF:  A4 and Letter (135 KB | 35 pages)Get Adobe® Reader®

Activity:  18701 views
Comments:  

Appendix: Migrating to the next schema

I have some bad news. Everything I've talked about with respect to the XML schema is obsolete. That's right: eBay is deprecating the XML API I've looked at in such detail. The good news is that application developers have until June 1, 2006 to make the migration.

I discussed the deprecated API because it's currently used by most applications that use the eBay XML API, particularly Services_Ebay. Illustrating the new API wouldn't be helpful to you if you needed to use the Services_Ebay debugging facilities. The schema changes are important only if you're developing an application that deals with the XML directly. If you develop an application that uses Services_Ebay, you can safely bet that it will be modified to use the new schema.

The bad news is that Services_Ebay is tied closely to the XML representation. When you say $user->UserId = 'librivore', Services_Ebay creates an element in the XML document called <UserId>. If you want to minimize the changes to your application, provide an interface layer between your application's business logic and Services_Ebay. That way, when Services_Ebay changes to match the new schema, you'll only need to change the interface layer and not your whole application. In other words, try to minimize the dependencies between your code and any unstable code you decide to use.

Here's how to write the GetUser XML in the new schema:

<GetUserRequest xmlns="urn:ebay:apis:eBLBaseComponents"> 
 <RequesterCredentials> 
   <eBayAuthToken>ABC...123</eBayAuthToken> 
 </RequesterCredentials> 
 <UserID>sampleuser</UserID> 
</GetUserRequest> 


The primary difference is that the root element of the document is the verb prepended to Request instead of the value of the <Verb> element.

The response has been changed in a similar fashion:

<GetUserResponse xmlns="urn:ebay:apis:eBLBaseComponents"> 
 <Timestamp>2005-03-18T02:58:59.289Z</Timestamp> 
 <Ack>Success</Ack> 
 <CorrelationID>00000000-00000000-...-00000000-0000000000</
CorrelationID> 
 <Version>397</Version> 
 <Build>20050316222508</Build> 
 <User> 
   <AboutMePage>false</AboutMePage> 
   <EIASToken>nY+sHZ2PjriAZeEqQ2d8jx9nY+seQ==</EIASToken> 
   <Email>sampleuser@foobar.com</Email> 
   <FeedbackScore>15</FeedbackScore> 
   <FeedbackRatingStar>Yellow</FeedbackRatingStar> 
	.
	.
	.
 </User> 
</GetUserResponse> 


7 of 9 | Previous | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and Web services, Open source
ArticleID=137246
TutorialTitle=Develop apps with Web services and the eBay SDK, Part 3: Develop eBay applications with PHP5 and Web services
publish-date=11082005
author1-email=ljagged@thinkpig.org
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.