16 lines
595 B
Plaintext
16 lines
595 B
Plaintext
// Service function definition
|
|
function geocode(address String) returns (GoogleGeocoding) {
|
|
@Resource{uri = "binding:GoogleGeocodingBinding"},
|
|
@Rest{method = _GET, uriTemplate = "/json?address={address}&sensor=false",
|
|
requestFormat = None, responseFormat = JSON}
|
|
}
|
|
|
|
// Invoke service function
|
|
call geocode("111 Maple Street, Somewhere, CO") returning to callback;
|
|
|
|
function callBack(result GoogleGeocoding in)
|
|
SysLib.writeStdout(result.status);
|
|
SysLib.writeStdout(result.results[1].geometry.location.lat);
|
|
SysLib.writeStdout(result.results[1].geometry.location.lng);
|
|
end
|