Abstraction Builder

Building simple and elegant programming abstractions

Nano Tutorial 3 - Hello eBay Finding

| Comments

This is the third tutorial of Nano Tutorial Series, in first and second tutorials, I showed you how to use Nano with simple services, these services only support one or two calls, the request/response structures are fairly simple, supporting these simple services only can’t show the full power of Nano, so in this and later tutorials, I will show you how to use Nano with industrial grade services, let’s start with eBay Finding service, please review its official site if you are not familiar with this service, basically, it lets you search items on eBay. eBay Finding service supports SOAP 1.2, so I will also show you how to configure Nano to support SOAP 1.2 protocol, also I will show how to set service required HTTP headers on Nano client.

The source of this tutorial is here.

Step 0 - Prerequisite

I suppose you have already read Nano tutorial 1 and 2, and basically you should know:

  • The wsdl driven development process supported by Nano.
  • How to add the Nano library and the generated service proxy into your Android project.

Step 1 - Generate Java Proxy from WSDL

Download mwsc and run following command in terminal to generate the proxy:

1
bin\mwsc.bat -nano -ebaysoa -d generated -p com.ebay.api.finding http://developer.ebay.com/webservices/Finding/latest/FindingService.wsdl

Depends on the network speed, you may need to wait a few moments to let the code generator download the wsdl and generate code, you may also download the wsdl and run the code generator with a local wsdl.

A few comments about the code generation:

  • I have added a special -ebaysoa codegen option, this is because eBay Finding service needs a per-call operation name HTTP header, I added this special flag in the code generator to let it generate the header for me, since I don’t want to add this header everytime I call an eBay Finding service, so this is just a special flag for eBay SOA services and for demo, or a hidden feature, not a generic codegen option.
  • By default, the code generator will derive package name from the target namespace in wsdl, you can use -p option to override this, for example, -p com.ebay.api.finding.

Step 2 - Create New Android Project, Add Nano Library and Generated Proxy into Your Project

Create a simple Android project called HelloeBayFinding in eclipse(or other IDE you prefer), then:

  1. Download latest nano library jar and add it to the libs folder of your Android project.
  2. Drag the above generated proxy into the src folder of your Android project.
  3. Add following user permissions in the AndroidManifest.xml file to enable network access.
1
2
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Now build the project to ensure it can build successfully.

You may now review the eBay Finding service SOAP interface generated from wsdl, to learn what kinds of functions are provided by eBay Finding service, and what kinds of parameters are needed to call the service, the interface is posted below:

FindingServicePortType_SOAPClient.java source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Generated by wsdl compiler for android/java
// DO NOT CHANGE!
package com.ebay.api.finding.client;


import com.leansoft.nano.ws.SOAPServiceCallback;
import com.leansoft.nano.ws.NanoSOAPClient;
import com.ebay.api.finding.FindItemsForFavoriteSearchResponse;
import com.ebay.api.finding.FindItemsByCategoryResponse;
import com.ebay.api.finding.FindItemsByProductResponse;
import com.ebay.api.finding.FindItemsByImageRequest;
import com.ebay.api.finding.GetSearchKeywordsRecommendationRequest;
import com.ebay.api.finding.FindItemsByCategoryRequest;
import com.ebay.api.finding.FindCompletedItemsResponse;
import com.ebay.api.finding.FindItemsAdvancedResponse;
import com.ebay.api.finding.FindItemsIneBayStoresResponse;
import com.ebay.api.finding.FindItemsForFavoriteSearchRequest;
import com.ebay.api.finding.FindItemsByKeywordsRequest;
import com.ebay.api.finding.FindItemsByProductRequest;
import com.ebay.api.finding.FindItemsIneBayStoresRequest;
import com.ebay.api.finding.FindItemsAdvancedRequest;
import com.ebay.api.finding.FindItemsByImageResponse;
import com.ebay.api.finding.GetVersionResponse;
import com.ebay.api.finding.GetHistogramsResponse;
import com.ebay.api.finding.GetVersionRequest;
import com.ebay.api.finding.GetSearchKeywordsRecommendationResponse;
import com.ebay.api.finding.FindItemsByKeywordsResponse;
import com.ebay.api.finding.GetHistogramsRequest;
import com.ebay.api.finding.FindCompletedItemsRequest;


/**
 This class is the SOAP client to the FindingServicePortType Web Service.
*/
public class FindingServicePortType_SOAPClient extends NanoSOAPClient {


    /**
     public method
    */
    public void getSearchKeywordsRecommendation(GetSearchKeywordsRecommendationRequest requestObject, SOAPServiceCallback<GetSearchKeywordsRecommendationResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "getSearchKeywordsRecommendation");

        super.invoke(requestObject, serviceCallback, GetSearchKeywordsRecommendationResponse.class);
    }

    /**
     public method
    */
    public void findItemsByKeywords(FindItemsByKeywordsRequest requestObject, SOAPServiceCallback<FindItemsByKeywordsResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsByKeywords");

        super.invoke(requestObject, serviceCallback, FindItemsByKeywordsResponse.class);
    }

    /**
     public method
    */
    public void findItemsByCategory(FindItemsByCategoryRequest requestObject, SOAPServiceCallback<FindItemsByCategoryResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsByCategory");

        super.invoke(requestObject, serviceCallback, FindItemsByCategoryResponse.class);
    }

    /**
     public method
    */
    public void findItemsAdvanced(FindItemsAdvancedRequest requestObject, SOAPServiceCallback<FindItemsAdvancedResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsAdvanced");

        super.invoke(requestObject, serviceCallback, FindItemsAdvancedResponse.class);
    }

    /**
     public method
    */
    public void findItemsByProduct(FindItemsByProductRequest requestObject, SOAPServiceCallback<FindItemsByProductResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsByProduct");

        super.invoke(requestObject, serviceCallback, FindItemsByProductResponse.class);
    }

    /**
     public method
    */
    public void findItemsIneBayStores(FindItemsIneBayStoresRequest requestObject, SOAPServiceCallback<FindItemsIneBayStoresResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsIneBayStores");

        super.invoke(requestObject, serviceCallback, FindItemsIneBayStoresResponse.class);
    }

    /**
     public method
    */
    public void findItemsByImage(FindItemsByImageRequest requestObject, SOAPServiceCallback<FindItemsByImageResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsByImage");

        super.invoke(requestObject, serviceCallback, FindItemsByImageResponse.class);
    }

    /**
     public method
    */
    public void getHistograms(GetHistogramsRequest requestObject, SOAPServiceCallback<GetHistogramsResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "getHistograms");

        super.invoke(requestObject, serviceCallback, GetHistogramsResponse.class);
    }

    /**
     public method
    */
    public void findCompletedItems(FindCompletedItemsRequest requestObject, SOAPServiceCallback<FindCompletedItemsResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findCompletedItems");

        super.invoke(requestObject, serviceCallback, FindCompletedItemsResponse.class);
    }

    /**
     public method
    */
    public void getVersion(GetVersionRequest requestObject, SOAPServiceCallback<GetVersionResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "getVersion");

        super.invoke(requestObject, serviceCallback, GetVersionResponse.class);
    }

    /**
     public method
    */
    public void findItemsForFavoriteSearch(FindItemsForFavoriteSearchRequest requestObject, SOAPServiceCallback<FindItemsForFavoriteSearchResponse> serviceCallback) {

        super.getAsyncHttpClient().addHeader("X-EBAY-SOA-OPERATION-NAME", "findItemsForFavoriteSearch");

        super.invoke(requestObject, serviceCallback, FindItemsForFavoriteSearchResponse.class);
    }


}

All the methods in the interface follow same calling paradigm - you call the service with required request object and a callback object implementing interface SOAPServiceCallback.

Step 3 - Implement Appliction Logic and UI, Call Proxy to Invoke Web Service as Needed.

First, create a shared service client as below:

FindingServiceClient.java source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.ebay.service.finding;

import com.ebay.api.finding.client.FindingServicePortType_SOAPClient;
import com.leansoft.nano.ws.SOAPVersion;

public class FindingServiceClient {
  
  public static String eBayFindingServiceURLString = "http://svcs.ebay.com/services/search/FindingService/v1";
  public static String eBayAppId = "YOUR APPID HERE";
  
  private static volatile FindingServicePortType_SOAPClient client = null;
  
  public static FindingServicePortType_SOAPClient getSharedClient() {
      if (client == null) {
          synchronized(FindingServiceClient.class) {
              if (client == null) {
                  client = new FindingServicePortType_SOAPClient();
                  client.setEndpointUrl(eBayFindingServiceURLString);
                  client.setSoapVersion(SOAPVersion.SOAP12); // ebay finding service supports SOAP 1.2
                  client.setContentType("application/soap+xml");
                  client.getAsyncHttpClient().addHeader("Accept", "application/soap+xml");
                  client.getAsyncHttpClient().addHeader("X-EBAY-SOA-SECURITY-APPNAME", eBayAppId);
                  client.getAsyncHttpClient().addHeader("X-EBAY-SOA-MESSAGE-PROTOCOL", "SOAP12");
                  client.getAsyncHttpClient().addHeader("X-EBAY-SOA-REQUEST-DATA-FORMAT", "SOAP");
              }
          }
      }
      
      return client;
  }
  
}

The shared client for eBay Finding service is a little more complex than the simple serivce client in tutorial 1 and 2, this is because that eBay Finding service needs a few HTTP headers set to work, let me give more comments:

  1. eBay Finding service support SOAP12, so we set the client to use SOAP12 protocol, this is not necessary since eBay Finding service also supports SOAP11(which is Nano default), we use SOAP12 here just for demo and to show the capability of Nano.
  2. eBay Finding service needs to set a few HTTP headers to work, for a list of required headers, please refer to doc here.
  3. One mandatory header for eBay Finding service is eBayAppId, you need to register on eBay developer site as an eBay developer then get this id, before your can run this demo, you must fill in your own eBayAppId in the shared client.

Now the UI part and application logic, for this hello world like sample, we just need a EditText for keyword input and Button to trigger eBay search by invoking listening method onClick which will indirectly call eBay Finding service through the proxy, fairly simple, see the full application logic in MainActivity class below:

MainActivity.java source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.leansoft.nano.sample;

import com.ebay.api.finding.AckValue;
import com.ebay.api.finding.ErrorData;
import com.ebay.api.finding.FindItemsByKeywordsRequest;
import com.ebay.api.finding.FindItemsByKeywordsResponse;
import com.ebay.api.finding.PaginationInput;
import com.ebay.api.finding.SearchItem;
import com.ebay.api.finding.client.FindingServicePortType_SOAPClient;
import com.ebay.service.finding.FindingServiceClient;
import com.leansoft.nano.soap12.Reasontext;
import com.leansoft.nano.ws.SOAPServiceCallback;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      
      Button searchButton = (Button) this.findViewById(R.id.search_button);
      
      searchButton.setOnClickListener(new OnClickListener() {

          @Override
          public void onClick(View arg0) {
              // Get shared client
              FindingServicePortType_SOAPClient client = FindingServiceClient.getSharedClient();
              client.setDebug(true); // enable soap message logging
              
              // Build request
              FindItemsByKeywordsRequest request = new FindItemsByKeywordsRequest();
              String keywords = ((EditText)findViewById(R.id.keyword_input)).getText().toString();
              request.keywords = keywords;
              PaginationInput pi = new PaginationInput();
              pi.pageNumber = 1;
              pi.entriesPerPage = 1;
              request.paginationInput = pi;
              
              // Make API call and register callbacks
              client.findItemsByKeywords(request, new SOAPServiceCallback<FindItemsByKeywordsResponse>() {

                  @Override
                  public void onSuccess(
                          FindItemsByKeywordsResponse responseObject) {
                      
                      if (AckValue.SUCCESS == responseObject.ack) {
                          if (responseObject.searchResult != null && responseObject.searchResult.count > 0) {
                              // show the title of the first found item
                              SearchItem item = responseObject.searchResult.item.get(0);
                              Toast.makeText(MainActivity.this, item.title, Toast.LENGTH_LONG).show();
                          } else { // no result
                              Toast.makeText(MainActivity.this, "No result", Toast.LENGTH_LONG).show();
                          }
                      } else { // response resident error
                          ErrorData errorData = responseObject.errorMessage.error.get(0);
                          Toast.makeText(MainActivity.this, errorData.message, Toast.LENGTH_LONG).show();
                      }
                  }

                  @Override
                  public void onFailure(Throwable error, String errorMessage) { // http or parsing error
                      Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();
                  }

                  @Override
                  public void onSOAPFault(Object soapFault) { // soap fault
                      com.leansoft.nano.soap12.Fault fault = (com.leansoft.nano.soap12.Fault)soapFault;
                      Reasontext reasonText = fault.reason.text.get(0);
                      Toast.makeText(MainActivity.this, reasonText.value, Toast.LENGTH_LONG).show();
                  }
                  
              });
          }
          
      });
  }
}

More comments to the serivce call code:

  1. I’ve added comments in the code so the whole service call flow should be easy to understand.
  2. We used the eBay Finding findItemsByKeywords call, which takes a keyword as input, and will return a list of matched items, for demo, we just need one item to display, so we set entries per page to 1.
  3. In the success handling logic, we show the title of the returned item using Android Toast component.
  4. Since we set the client to use SOAP12 protocol, in the soap fault error handling logic, we need to cast the soapFault variable to type SOAP12Fault and handle it accordingly.
  5. eBay Finding service supports response resident error(RRE), so even we get a success response, we still need to check the response for resident error and handle it accordingly.

Final Step - Run the Demo

Let’s run the demo on simulator, see a screen shot below:

and the debug output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
04-17 14:17:49.157: D/NanoSOAPClient(317): Sending request to : http://svcs.ebay.com/services/search/FindingService/v1
04-17 14:17:49.157: D/NanoSOAPClient(317): Request HTTP headers : 
04-17 14:17:49.157: D/NanoSOAPClient(317): {
04-17 14:17:49.157: D/NanoSOAPClient(317):     X-EBAY-SOA-OPERATION-NAME="findItemsByKeywords"
04-17 14:17:49.157: D/NanoSOAPClient(317):     X-EBAY-SOA-SECURITY-APPNAME="*******"
04-17 14:17:49.157: D/NanoSOAPClient(317):     Accept="application/soap+xml"
04-17 14:17:49.157: D/NanoSOAPClient(317):     X-EBAY-SOA-MESSAGE-PROTOCOL="SOAP12"
04-17 14:17:49.157: D/NanoSOAPClient(317):     X-EBAY-SOA-REQUEST-DATA-FORMAT="SOAP"
04-17 14:17:49.157: D/NanoSOAPClient(317): }
04-17 14:17:49.157: D/NanoSOAPClient(317): Request message : 
04-17 14:17:49.157: D/NanoSOAPClient(317): <?xml version='1.0' encoding='UTF-8' ?>
04-17 14:17:49.157: D/NanoSOAPClient(317): <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ebay.com/marketplace/search/v1/services">
04-17 14:17:49.157: D/NanoSOAPClient(317):   <soapenv:Body>
04-17 14:17:49.157: D/NanoSOAPClient(317):     <findItemsByKeywordsRequest>
04-17 14:17:49.157: D/NanoSOAPClient(317):       <paginationInput>
04-17 14:17:49.157: D/NanoSOAPClient(317):         <pageNumber>1</pageNumber>
04-17 14:17:49.157: D/NanoSOAPClient(317):         <entriesPerPage>1</entriesPerPage>
04-17 14:17:49.157: D/NanoSOAPClient(317):       </paginationInput>
04-17 14:17:49.157: D/NanoSOAPClient(317):       <keywords>nexus 2</keywords>
04-17 14:17:49.157: D/NanoSOAPClient(317):     </findItemsByKeywordsRequest>
04-17 14:17:49.157: D/NanoSOAPClient(317):   </soapenv:Body>
04-17 14:17:49.157: D/NanoSOAPClient(317): </soapenv:Envelope>
04-17 14:17:50.509: D/SOAPHttpResponseHandler(317): Response HTTP status : 200
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317): Response HTTP headers : 
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317): {
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-ESB-GUID="urn:uuid:CC62052BA7B85308BC1367424536385"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-SERVICE-NAME="{http://www.ebay.com/marketplace/search/v1/services}FindingService"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     Connection="Keep-Alive"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-MESSAGE-PROTOCOL="SOAP12"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     Server="Apache-Coyote/1.1"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-REQUEST-ID="13e185c3-12d0-a0a9-ee72-82e2fff134e0!FindingService!10.10.158.231!v3apifindingcore[!FindItemServiceNextGen!10.10.158.231!v3apifindingcore[!MetadataDependencyService!10.86.122.101!v3mddscore[]]]"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-OPERATION-NAME="findItemsByKeywords"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-SERVICE-VERSION="1.12.0"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     Transfer-Encoding="chunked"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     Date="Wed, 17 Apr 2013 14:18:15 GMT"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-RESPONSE-DATA-FORMAT="XML"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-ESB-ENDPOINTURL="/Root/ESBFunctions/Services/Ports/7003/profile/search/v1/FindingService/destination_default/address_synapse"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     Content-Encoding="gzip"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-SERVICE-METRICS="203269893"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     X-EBAY-SOA-LOCALE-LIST="en-US_US"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317):     Content-Type="application/soap+xml;charset=UTF-8"
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317): }
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317): Response message : 
04-17 14:17:50.517: D/SOAPHttpResponseHandler(317): <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header/><soapenv:Body><findItemsByKeywordsResponse xmlns="http://www.ebay.com/marketplace/search/v1/services"><ack>Success</ack><version>1.12.0</version><timestamp>2013-04-17T14:18:15.791Z</timestamp><searchResult count="1"><item><itemId>300853070145</itemId><title>2x Home Wall Chargers for Samsung Galaxy s 2 Epic Touch , 9100 , Nexus 4G</title><globalId>EBAY-US</globalId><primaryCategory><categoryId>123417</categoryId><categoryName>Chargers & Cradles</categoryName></primaryCategory><galleryURL>http://thumbs2.ebaystatic.com/m/mDzv8Uawtt-rUUIqsXn7WAQ/140.jpg</galleryURL><viewItemURL>http://www.ebay.com/itm/2x-Home-Wall-Chargers-Samsung-Galaxy-s-2-Epic-Touch-9100-Nexus-4G-/300853070145?pt=US_Cell_Phone_PDA_Chargers</viewItemURL><paymentMethod>PayPal</paymentMethod><autoPay>false</autoPay><postalCode>60654</postalCode><location>Chicago,IL,USA</location><country>US</country><shippingInfo><shippingServiceCost currencyId="USD">0.0</shippingServiceCost><shippingType>Free</shippingType><shipToLocations>US</shipToLocations><expeditedShipping>true</expeditedShipping><oneDayShippingAvailable>true</oneDayShippingAvailable><handlingTime>1</handlingTime></shippingInfo><sellingStatus><currentPrice currencyId="USD">4.95</currentPrice><convertedCurrentPrice currencyId="USD">4.95</convertedCurrentPrice><sellingState>Active</sellingState><timeLeft>P10DT1H40M39S</timeLeft></sellingStatus><listingInfo><bestOfferEnabled>false</bestOfferEnabled><buyItNowAvailable>false</buyItNowAvailable><startTime>2013-01-27T15:53:54.000Z</startTime><endTime>2013-04-27T15:58:54.000Z</endTime><listingType>StoreInventory</listingType><gift>false</gift></listingInfo><returnsAccepted>true</returnsAccepted><condition><conditionId>1000</conditionId><conditionDisplayName>New</conditionDisplayName></condition><isMultiVariationListing>false</isMultiVariationListing><topRatedListing>true</topRatedListing></item></searchResult><paginationOutput><pageNumber>1</pageNumber><entriesPerPage>1</entriesPerPage><totalPages>10679</totalPages><totalEntries>10679</totalEntries></paginationOutput><itemSearchURL>http://www.ebay.com/sch/i.html?_nkw=nexus+2&_ddo=1&_ipg=1&_pgn=1</itemSearchURL></findItemsByKeywordsResponse></soapenv:Body></soapenv:Envelope>

let’s also try a soap fault case, for example, if you forget to fill in your eBayAppId in the shared client, then you will get:

This is just a bare minimum eBay Finding service based application, for a demo with more functions, please see the eBayDemoApp sample in the sample\webservice folder of Nano source, eBayDemoApp is a composite app which calls two eBay serivces behind, this app searches eBay by calling eBay Fining service, showes a list of matched items on UI, when an item is clicked, it will show item details by calling eBay Shopping service, see a screen shot below.

Now it’s your turn to create Android applications based on eBay Finding web service, see your next great service based app.

Comments