Archive for the ‘wsdl’ Category

…. let’s resume  the Consumer creation process.

My first attempt to run the consumer throw an Server internal exception, as a result Error 500. WTF! I pasted the url at my FF browser and the answer appeared: “Missing SOA operation name header”. Browsing the eBay doco I found that I need to add at least 2 http headers to my request. (for eBay service interaction, I recommend you to take a look at eBay’s devzone site ). The headers are:

  • OPERATION-NAME: The name of the call you are using (for example, findItemsAdvanced or getHistograms).
  • SECURITY-APPNAME: This is the application ID (AppID) for the service consumer. You obtain an AppID by joining the eBay Developers Program.

As it request, I had to join the eBay program. Simple process with the exception of the fully complex password it requires, despite you want to play in his sandbox environment. Btw, do you remember when I added a new environment at Consumer creation wizard?? (part I).

Now, with a eBay sandbox user, let’s set the headers.

Under your META-INF/soa/client/config/FindingServiceV1Consumer/sandbox/ you will find the ClientConf.xml file. Here we could set any particular setting for the rpc, such us endpoints, protocol, headers, timeouts, retries, etc….and headers is what I need!!

FMI about header settings please refer to Transport Header Mapping and Configuring Custom Transport Headers.

In this case both end point in the call are SOA implementations we can avoid the header mappings. So, just added into my ClientConf.xml the following lines:

<transport name="HTTP11">
	<class-name>
		org.ebayopensource.turmeric.runtime.sif.impl.transport.http.HTTPSyncAsyncClientTransport
	</class-name>
	<header-options>
		<option name="X-EBAY-SOA-OPERATION-NAME">findItemsByKeywords</option>
		<option name="X-EBAY-SOA-SECURITY-APPNAME">xxxxxxxxxxxxxxxxxxxxxxxxx</option>   <!-- my sandbox appId -->
	</header-options>
</transport>

At this point of the game everything seems to be done, let’s press Run so…

and the response says:

New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
LG Chocolate Touch VX8575 Verizon Retail Box Cell Phone
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
SAMSUNG A837 RUGBY AT&T CAMERA PTT GSM PHONE BLACK
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
Palm Treo 700wx (Verizon)
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
NEW T MOBILE MOTO MOTOROLA CLIQ WIFI BLUR MB200 ANDRIOD
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
New unlocked FM mini Iphone KA09 GSM AT&T T-Mobile Cell
NEW SAMSUNG A887 SOLSTICE UNLOCKED 3G PHONE BLUE……..

In case you get in timeouts troubles please refer to TimeOuts settings

HI,

In this post I will show you how to create a new Consumer service with Turmeric Eclipse plugin. I used a wsdl from an existing eBay’s Developer Service.
For general steps and preconditions, please refer to Create a Consumer using Turmeric Eclipse Plugin.

In your Eclipse,  go to File -> new -> other

new Consumer

This is the wsdl I choose:

http://developer.ebay.com/webservices/finding/latest/FindingService.wsdl

As you can see, I set two environments, production and local. This will create two different configuration files, as follows:

Finally, I implemented the Consumer Service. I selected the SharedFindingServiceV1Consumer class as superclass.

(Please take a look at BaseFindingServiceRequest in the wsdl for more info about the needed parameters in your request.)

	public static void main(String[] args) {
		FindItemsByKeywordsRequest req = new FindItemsByKeywordsRequest();
		req.setKeywords("phone");
		
		try {
		FindItemsByKeywordsResponse res;
		
		
		res = new FindingServiceV1Consumer("FindingServiceV1Consumer", "sandbox").findItemsByKeywords(req);
		if(res.getSearchResult()!=null && res.getSearchResult().getItem().size()>0){
			for (SearchItem item : res.getSearchResult().getItem()) {
				System.out.println(item.getTitle());
			}
		}
		
		
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

now ,let’s compile:

 


aja!… that’s because I didn’t compile my FindingServiceV1 project yet. Once I did it, a new jar was created under worspace/FindingServiceV1/target, in my case: FindingServiceV1-1.9.0.jar. We need to add this jar into our local maven repository. Now, let’s try a new Consumer compilation. And this time compiles  :).

Is time to try my classes, “run Consumer, run!!!!”

[ TO BE CONTINUED]