On Mon, Oct 17, 2011 at 10:19 AM, Willis C White <[email protected]> wrote:
> function sendAndGetInfo(){
> try{
> var info = new Object();
> info.Firstname = document.getElementById("Firstname").value;
> info.Lastname = document.getElementById("Lastname").value;
> info.Description =
> document.getElementById("Description").value;
> info.Latitude = document.getElementById("Latitude").value;
> info.Longatude = document.getElementById("Longatude").value;
> json_data = JSON.stringify(info);
>
> console.log(json_data);
>
> HelloWorldService.setPersonInfo(json_data, handleInfoResponse);
>
> }catch(e){
> console.dir(e);
> }
> }
You could try :
function sendAndGetInfo(){
try{
var person = new Object();
person.firstName = document.getElementById("Firstname").value;
person.lastName = document.getElementById("Lastname").value;
person.description =
document.getElementById("Description").value;
person.latitude = document.getElementById("Latitude").value;
person.longitude = document.getElementById("Longatude").value;
service.someOperation(person, handleInfoResponse);
}catch(e){
console.dir(e);
}
}
This should work, assuming your service have a "someOperation"
method that accepts a "Person" parameter that contains setters for
firstName, lastName, description, latitude and longitude.
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/