MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

opensocial.Container.get().makeRequest is not a function

Last post 03-12-2008 3:15 PM by Jeremy. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 03-10-2008 1:27 AM

    • Naseem
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 8

    opensocial.Container.get().makeRequest is not a function

    As of a few minutes ago, my previously working js file has started failing with this error message:

    opensocial.Container.get().makeRequest is not a function

     

    Is anyone else encountering a similar problem?  

     

    Thanks,

    Naseem 

  • 03-10-2008 1:47 AM In reply to

    • Naseem
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 8

    Re: opensocial.Container.get().makeRequest is not a function

    Problem fixed now.


  • 03-11-2008 4:32 AM In reply to

    Re: opensocial.Container.get().makeRequest is not a function

    hi,

    I am getting the same error now. Did u ever figure out what it was, is it something on myspace side or clientside?

    regards,

    Adrian

  • 03-11-2008 9:43 AM In reply to

    • Frank
    • Not Ranked
    • Joined on 02-14-2008
    • Posts 2

    Re: opensocial.Container.get().makeRequest is not a function

    Same problem; any input on how you solve the problem would be really appreciated!

     

    Thanks,

    Frank 

  • 03-11-2008 9:48 AM In reply to

    • phong
    • Top 150 Contributor
    • Joined on 01-30-2008
    • Posts 33

    Re: opensocial.Container.get().makeRequest is not a function

    This is the response from a GET makeRequest: 
     
    html>
        <head>
            <title>Runtime Error</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>
        <body bgcolor="white">
                <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
                <h2> <i>Runtime Error</i> </h2></span>
                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
                <b> Description: </b>An application error occurred on the server. The current custom error
     settings for this application prevent the details of the application error from being viewed remotely
     (for security reasons). It could, however, be viewed by browsers running on the local server machine
    .
                <br><br>
                <b>Details:</b> To enable the details of this specific error message to be viewable on remote
     machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file
     located in the root directory of the current web application. This &lt;customErrors&gt; tag should then
     have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>
                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>
    &lt;!-- Web.Config Configuration File --&gt;
    &lt;configuration&gt;
        &lt;system.web&gt;
            &lt;customErrors mode=&quot;Off&quot;/&gt;
        &lt;/system.web&gt;
    &lt;/configuration&gt;</pre></code>
                      </td>
                   </tr>
                </table>
                <br>
                <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page
     by modifying the &quot;defaultRedirect&quot; attribute of the application's &lt;customErrors&gt; configuration
     tag to point to a custom error page URL.<br><br>
                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>
    &lt;!-- Web.Config Configuration File --&gt;
    &lt;configuration&gt;
        &lt;system.web&gt;
            &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt
    ;
        &lt;/system.web&gt;
    &lt;/configuration&gt;</pre></code>
                      </td>
                   </tr>
                </table>
                <br>
        </body>
    </html>
  • 03-11-2008 9:56 AM In reply to

    • mEgo
    • Top 500 Contributor
    • Joined on 02-02-2008
    • Posts 14

    Re: opensocial.Container.get().makeRequest is not a function

    I'm getting a similar problem: opensocial.ContentRequestParameters has no properties.

     I'm also getting a 404 for this request: http://api.msappspace.com/OpenSocial/MyOpenSpace001.Mappers.v07.js

    And I have been getting 500 errors for these requests: http://api.msappspace.com/proxy/relay.proxy

     

  • 03-11-2008 10:41 AM In reply to

    • Ira
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 9

    Re: opensocial.Container.get().makeRequest is not a function

    Same. 

  • 03-11-2008 6:49 PM In reply to

    • Naseem
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 8

    Re: opensocial.Container.get().makeRequest is not a function

    Not sure if your problem has the same root cause as mine - for me, it was an error on the myspace side. 

    It just started working again a few minutes later with no changes from my end.

     

    Sorry I can't be more helpful... 

  • 03-11-2008 7:17 PM In reply to

    Re: opensocial.Container.get().makeRequest is not a function

    I think opensocial.Container.get().makeRequest is an opensocial 0.6 call.  With 0.7 being launched a couple of hrs ago the correct call would be something like gadgets.io.makeRequest().  I got this code but it doesnt work yet... anyone care to correct?

    <div id="target" style="padding:0px;">waiting....</div>

    <script type="text/javascript">
    function init(gourl) { 
    var target = document.getElementById('target'); 
       var params = {};
    params[gadgets.io.METHOD] = gadgets.io.MethodType.GET;
    params[gadgets.io.CONTENT_TYPE] = gadgets.io.ContentType.HTML;
    params[gadgets.io.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
    try{   gadgets.io.makeRequest(   gourl,   function(content)    {    target.innerHTML = content;   }, params);   } 

    catch(er){  target.style.backgroundColor = '#f00';  target.style.color = '#fff';  target.innerHTML = er.message;  }
    }
    </script>

  • 03-11-2008 7:29 PM In reply to

    Re: opensocial.Container.get().makeRequest is not a function

    It's working for me, but returning an object as the content. The content.text property contains the output.

  • 03-11-2008 9:57 PM In reply to

    • Mark
    • Top 50 Contributor
    • Joined on 02-05-2008
    • Posts 72

    Re: opensocial.Container.get().makeRequest is not a function

    It's working for me, but setting AUTHENTICATION to AuthorizationType.SIGNED is not sending any of the additional oauth parameters, and the viewer and owner ID are still sent in the headers instead of the query string.

  • 03-12-2008 12:20 AM In reply to

    Re: opensocial.Container.get().makeRequest is not a function

    That code chunk above is slightly wrong --

    params[gadgets.io.METHOD] = gadgets.io.MethodType.GET;
    params[gadgets.io.CONTENT_TYPE] = gadgets.io.ContentType.HTML;
    params[gadgets.io.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;

    Should read:

    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT; //There is no HTML?!?
    params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;

    The other ContentTypes are DOM (for XML) and the feeds, but I don't know if those are implemented yet. TEXT is for HTML, if you didn't get that. At least, that's what the specs say, but then the specs also say that it defaults to ContentType.HTML, so I'm just confused.

    *ETA:: Seems it handles ContentType.HTML just fine, so, you might want to leave that line *

    As far as the return, yeah, it's wrapped in an object. I haven't fully gotten into it, just far enough to get a successful XML return and parse it, but as phil noted '.text' is the HTML as a string, and '.data' is the actual response data (this is what I'm using to parse the XML return). And, no, it's not a bug, it's how it is in the 0.7 specs.

    Anyway, you'll have to add the 'RequestParameters' bit or SIGNED will be ignored completely.

     

  • 03-12-2008 9:57 AM In reply to

    Re: opensocial.Container.get().makeRequest is not a function

    Jeremy,

    I did the update and still get the [object][object] message... Here is the code what I'm using, let me know if you see anything wrong.  In the meantime the old way (opensocial.ContentRequestParameters/pensocial.Container.get().makeRequest()) still works like before.


    <div id="target" style="padding:10px;">waiting....</div>
    <script type="text/javascript">

    function init(gourl) { 
    var target = document.getElementById('target'); 
       var params = {};
    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT; //There is no HTML?!?
    params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;


    try{     gadgets.io.makeRequest(   gourl,   function(content)    {    target.innerHTML = content;   },  params);  
     } 
    catch(er){  target.style.backgroundColor = '#f00';  target.style.color = '#fff';  target.innerHTML = er.message;  }
    }

    init("http://www.google.com");

    </script>

  • 03-12-2008 3:15 PM In reply to

    Re: opensocial.Container.get().makeRequest is not a function

    Oh, sorry, I didn't finish checking your code. Someone else had a similar thing happen, and I put the answer there, and forgot to here.

    The content returned by 0.7 makeRequest is different than the 0.6 version -- it's enclosed in an object of objects, hence that's what you see when you just try "target.innerHTML = content" -- that should read :

    target.innerHTML = content.text;

    or in other words, you want the text of the content transcribed into a string. There is also 'content.data' which is the raw data of the content returned, useful for XML and JSON (and I expect newsfeeds but I haven't tried those yet).

    My apologies for leaving you with only half an answer.

Page 1 of 1 (14 items)