Skip to content

Instantly share code, notes, and snippets.

@ctoestreich
Created November 28, 2011 01:24
Show Gist options
  • Save ctoestreich/1398694 to your computer and use it in GitHub Desktop.
Save ctoestreich/1398694 to your computer and use it in GitHub Desktop.
def serviceSoapTest = {
String addBusinessPartner = "", helloWorld = ""
Boolean isConnected = false, isAlive = false, addBP = false
GetDataTableResult getDataTableResult = null
Exception soapServiceException = null
Address address = new Address(address1: "22575 Highway 6 South", address2: "Navasota, Texas", postalCode: "77868")
BusinessPartner businessPartner = new BusinessPartner(cardCode: "C00570",
cardName: "Select Sires",
groupCode: 1,
taxCode: "99-9999999",
priceListNum: 1,
phone: "614-873-4683",
mobilePhone: "614-246-1055",
fax: "614-873-5751",
terms: 7,
billToAddress: address,
email: "AThiergartner@selectsires.com")
try {
isConnected = serviceSoapClient.connected()
isAlive = serviceSoapClient.isAlive()
helloWorld = serviceSoapClient.helloWorld()
getDataTableResult = serviceSoapClient.getDataTable("select sqrt(9)")
// addBP = serviceSoapClient.addBP(businessPartner)
} catch (Exception e) {
println e
soapServiceException = new Exception("GetDataTable invocation threw an error ${e.getMessage()}")
}
printOut getDataTableResult.any
render(view: '/index', model: [isConnected: isConnected,
isAlive: isAlive,
helloWorld: helloWorld,
getDataTableResult: getDataTableResult.any.firstChild?.firstChild?.firstChild?.firstChild.data,
soapServiceException: soapServiceException?.message ?: ""])
}
private printOut(elem) {
println elem
elem?.childNodes.each {
printOut it
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment