JQuery Ajax data - how to send a "object in object" to JSON server?

JQuery Ajax data - how to send a "object in object" to JSON server?

Hello to all,
i have a problem to send a "object in object" as json ajax data to a webservice.

My jquery code:

  1. $.ajax({
  2.         type: "POST",
  3.         url: "http://localhostl/webservice/service.php?JSON",
  4.         data: {
  5.         "call" : "IsSessionValid",
  6.         "request" : [{
  7.         "apiRequestHeader" : {
  8.         "sessionToken" : "XXXXXXXXXXXXXXXXXXXXXXXXXX"
  9.         }
  10.         }]
  11.         },        
  12.         success: function(data){alert("OK: " + data);},
  13.         failure: function(errMsg) {
  14.             alert("ERROR: " + errMsg);
  15.         }
  16.   });
As you can see, my send data needs to be a "class in class" or "object in object" (The code is cutted a little bit to not confuse you). Here a example how the object looks like in php:

  1. $myObject = new MyObject();
  2. $myObject->apiRequestHeader = new ApiRequestHeader();

  3. $myObject->apiRequestHeader->sessionToken = "XXXXXX";
  4. $myObject->bla  = "xxx";
  5. ...
  6. ...
 
I know that the http transfer has the syntax "param1=value1&param2=value2...", but i need to pass a real object to the server. 

Somewhere i read that it should be possible via json2.js (project name is "jquery-json" at  http://code.google.com/p/jquery-json/ ). But i found now way or hints how to use it in code. 
 
Can me help anybody to understand how to make it work? Or is there now way to do this with json + jquery?
Thank you for your time!

Greets,
Marty McFly ;)