SpencerUresk

Random posts about Java, software development, politics, and economics

 RSS Feed

Add to Google Reader or Homepage

I couldn’t find any tutorials on how to use Amazon AWS with GroovyWS, so I took a few minutes to figure out how to do it. Here is some sample code:

import groovyx.net.ws.WSClient

def proxy = new WSClient(“http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl?”, this.class.classLoader)

def req = proxy.create(“com.amazon.webservices.awsecommerceservice._2008_04_07.ItemSearchRequest”)

req.searchIndex = ‘Books’
req.keywords = “Groovy and Grails”

def search = proxy.create(“com.amazon.webservices.awsecommerceservice._2008_04_07.ItemSearch”)

search.AWSAccessKeyId = “your id here”
search.request.add(req)

def res = […]

This is the first of a two part series showing how easy it is to expose and consume web services using the Spring Framework and XFire. In this part, we’ll be going through exposing the web services. This assumes you are using the following:
- Maven 2 (for dependencies)
- Spring 2.0 (although, it should work fine […]