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> |

