For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

How to interact with Open eBay Framework

  • Answer ID 1367
  • Published 02/24/2009 11:04 AM
  • Updated 10/20/2013 06:41 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=1367
Product
How to interact with Open eBay Framework? Do you have a sample application that demonstrate the process?

Summary   

To interact with Open eBay you need to set up a listener for the following user events:

    1.  Subscribe and Unsubscribe

    2.  Start application


Detailed Description

1. When the Subscribe/Unsubscribe button is clicked. 
    a) The Open eBay Participant Interface service calls addSubscriber or removeSubscriber API as below, appends the cmd=addSubscriber or cmd=removeSubscriber parameter and sends to the EndPoint.Management URL specified in your DD. The subscriber's information including User Auth Token, UserID and User's EIASToken is also passed in addSubscriber API request.  
           

                   addSubscriberRequest

  
<addSubscriberRequest xmlns="http://sample.echo.ebay.com" xmlns:sct="http://www.ebay.com/soaframework/common/types" xmlns:ms="http://www.ebay.com/marketplace/services"> 
<ms:header>
<ms:recipient appId="xxx" /> 
<ms:sender appId="com.ebay.echo"> 
<ms:token expirationDate="2010-07-09T12:08:49.000-07:00" issuingAuthority="ECHO" type="Value">
<ms:tokenValue>EIDPToken</ms:tokenValue>
</ms:token>
</ms:sender>
</ms:header>
<ms:subscriptionId>263</ms:subscriptionId> 
<ms:subscriberInfo>
<ms:userName>User Name</ms:userName>
<ms:EIASToken>xxxx*</ms:EIASToken> 
<ms:authToken issuingAuthority="ECHO" type="Value">
<ms:tokenValue>User Auth Token </ms:tokenValue>
</ms:authToken>
</ms:subscriberInfo>
<ms:subscriptionData />
</addSubscriberRequest>


                 removeSubscriberRequest 

<removeSubscriberRequest xmlns="http://sample.echo.ebay.com" xmlns:sct="http://www.ebay.com/soaframework/common/types" xmlns:ms="http://www.ebay.com/marketplace/services"> 
<ms:header>
<ms:recipient appId="xxx" /> 
<ms:sender appId="com.ebay.echo"> 
<ms:token expirationDate="2009-02-19T16:50:03.541-07:00" issuingAuthority="ECHO" type="Value">
<ms:tokenValue>EIDPToken</ms:tokenValue>
</ms:token>
</ms:sender>
</ms:header>
<ms:subscriptionId>104</ms:subscriptionId>
</removeSubscriberRequest>



   b) Upon receiving the subscription request, you should make the OpeneBayIdentityProviderService.authenticate request to verify the sender.tokenValue passed in the subscription calls

   c) Then, your application needs to send addSubscriberResponse with Approved status to allow the user to access your application and removeSubscriberResponse to indicate you have received the request. Here are the sample addSubscriberResponse and removeSubscriberResponse payloads. 

                  addSubscriberResponse

<addSubscriberResponse xmlns="http://www.ebay.com/marketplace/services">
<ack>Success</ack>
<errorMessage></errorMessage>
<version>String</version>
<timestamp>2009-2-17 00:00:00 06:00</timestamp>
<subscriptionStatus status="Approved">
<subscriptionMessage>Subscription Approved</subscriptionMessage>
</subscriptionStatus>
</addSubscriberResponse>

             removeSubscriberResponse
<removeSubscriberResponse xmlns="http://www.ebay.com/marketplace/services">
<ack>Success</ack>
<version>String</version>
<timestamp>
<removeSubscriberResponse xmlns="http://www.ebay.com/marketplace/services">
<ack>Success</ack>
<version>String</version>
<timestamp>2009-2-17 00:00:00 06:00</timestamp>
</removeSubscriberResponse>



 c) Keep in mind that Open eBay Participant Interface only supports HTTP post method.


2. After a user is successfully subscribed, the Start button would be activated. When the Start button is clicked:
  a)
The Open eBay Framework appends the sessionId parameter as sessionId=5d0d555d44d343534594d3453456e4236re44 and sends a Start HTTP request to EndPoint.InSession URL specified in your DD.
  c) Your application makes OpeneBayApplicationIntegrationService.getSession API request:
         - specify the received sessionId in the request and sends the request as below:

                getSessionRequest

 <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://www.ebay.com/marketplace/services">
<soap:Header/>
<soap:Body>
<ser:getSessionRequest>
<ser:sessionId>5d0d555d44d343534594d3453456e4236re44</ser:sessionId>
</ser:getSessionRequest>
</soap:Body>
</soap:Envelope>



    - render your application when the getSessionResponse is successfully returned to you with the <subscriberInfo> container.

3.  Attached Echo.war is the sample Java Servlet application that demostrates the steps described above. There are two servlets: SubscriberServlet and SessionServlet and which are for listening the Subscribe/Unsubscribe  and Start user events.   
     To use the Echo servlet application, you just need to specify your Open eBay Developer key set and your client application URL as below in the WEB-INF/configuration.xml file:

    <entry key="APPNAME">YOUR ECHO AppName</entry>
    <entry key="DEVNAME">YOUR DevName</entry>
    <entry key="CERT">YOUE ECHO CERT</entry>
    <entry key="PROTOCOL">SOAP12</entry>
    <entry key="CLIENTAPPLICATIONURL">YOUR APPLICATION URL</entry>

   The application is tested under JDK1.6 and Tomcat 6.0.

   NOTE. The source code is available in the attached archived NetBeans procject file: Echo.zip


 

File Attachments

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter