Hi,

Your code looks ok, is the data returned in your second makeRequest valid
JSON?  When iGoogle makes the request it is passed through a proxy and
should start with "thow 1; <don't be evil' >" followed by the JSON object,
it is this that needs to be valid.  If it can't be deserialized then your
method will not be called.

If you could provide an example of the response that would be good.

Kind Regards,
Paul

On Wed, Mar 31, 2010 at 6:07 AM, vamshi <[email protected]>wrote:

> hi friends,
>
>  I am very new to igoogle development, I am trying to make a igoogle
> gadget using ajax.
>
> I wrote the code like this for call the server
>
> <script type="text/javascript">
> var sessionId = null;
> function login()
> {
>  var url="xxx";
>  alert(url);
>    var params = {};
>  gadgets.io.makeRequest(url, response, params);
> }
> function response(obj){
> var jsonText = obj.text;
> jsonText = eval('(' + jsonText + ')');
> sessionId = jsonText.platform.login.sessionId;
> alert("Session Id : "+sessionId);
> getOrderList();
> }
> function getOrderList()
> {
>  alert("Your in correct path");
>
>   var execURL = "yyy";
>
>
>
>  var params = {};
>  var postdata =
> {platform:{execClass:
> {clazz:"clazz",method:"process",AppNo:"0000000025",emailaddress:"xxx.com
> ",pwd:"11111",Query:"SELECT
> SD_DOC, ITM_NUMBER,REQ_QTY, MATERIAL, QTY,NET_PRICE FROM WHERE
> CUSTOMER_NUMBER = 0000000025 and SALES_ORGANIZATION = APL"}}}));
>  postdata = gadgets.io.encodeValues(postdata);
>  params[gadgets.io.RequestParameters.METHOD] =
> gadgets.io.MethodType.POST;
>
> params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> gadgets.io.ContentType.JSON;
>
>  params[gadgets.io.RequestParameters.HEADERS] =
> {"Cookie":"JSESSIONID='+sessionId+'", "Content-Type": "application/
> json"};
>
>
>  params[gadgets.io.RequestParameters.POST_DATA]= postdata;
>  gadgets.io.makeRequest(execURL,orderListResp,params);
> }
> function orderListResp(obj)
> {
>  var respp = obj.text;
>  alert(respp);
> }
> </script>
> <input type="button" id="but1" onclick="login()" value="Click Me" />
>
>
>
> Here I am using JSON as a content type.
>
> after I call the second url, I am getting 200 Response code but I am
> not getting black response.
>
> please help me ,
>
> thanks very much
>
> --
> You received this message because you are subscribed to the Google Groups
> "iGoogle Developer Forum" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-gadgets-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/Google-Gadgets-API?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en.

Reply via email to