locked
How to access remote relative content? RRS feed

  • Question

  • We're trying to display album artwork via Last.FM's API using http://ws.audioscrobbler.com/2.0/, which will return a JSON document with Album Info, Artist Info, and an absolute link to the album artwork.

    APPHOST9601: Can’t load <http://ws.audioscrobbler.com/2.0/?artist=God+Dethroned&method=artist.getInfo&api_key=__REMOVED__&callback=jsonp1353293825164&format=json>. An app can’t load remote web content in the local context.File: default.html

    We've tried adding a URI for "http://ws.audioscrobbler.com/*" to the package.appxmanifest file for the INCLUDE rule; no success.

     This is an example of the file we're trying to retrieve:

    jsonp1353296137635({"artist":{"name":"Hollywood Undead","mbid":"321fdfbb-426b-43f7-8295-fa9aca6348d9","url":"http:\/\/www.last.fm\/music\/Hollywood+Undead","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34\/12148127.jpg","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64\/12148127.jpg","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/12148127.jpg","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/252\/12148127.jpg","size":"extralarge"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/500\/12148127\/Hollywood+Undead+hupic.jpg","size":"mega"}],"streamable":"1","stats":{"listeners":"618748","playcount":"21472129"},"similar":{"artist":[{"name":"Deuce","url":"http:\/\/www.last.fm\/music\/Deuce","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34\/72575182.jpg","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64\/72575182.jpg","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/72575182.jpg","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/252\/72575182.jpg","size":"extralarge"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/_\/72575182\/Deuce+_America.jpg","size":"mega"}]},{"name":"9Lives","url":"http:\/\/www.last.fm\/music\/9Lives","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34\/61580983.jpg","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64\/61580983.jpg","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/61580983.jpg","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/252\/61580983.jpg","size":"extralarge"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/_\/61580983\/9Lives+y_c85021bc.jpg","size":"mega"}]},{"name":"Thousand Foot Krutch","url":"http:\/\/www.last.fm\/music\/Thousand+Foot+Krutch","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34\/75758222.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64\/75758222.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/75758222.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/252\/75758222.png","size":"extralarge"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/500\/75758222\/Thousand+Foot+Krutch+teiwwb.png","size":"mega"}]},{"name":"Brokencyde","url":"http:\/\/www.last.fm\/music\/Brokencyde","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34\/28022799.jpg","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64\/28022799.jpg","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/28022799.jpg","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/252\/28022799.jpg","size":"extralarge"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/_\/28022799\/Brokencyde+myspacedefaultcrazygood.jpg","size":"mega"}]},{"name":"Dead by April","url":"http:\/\/www.last.fm\/music\/Dead+by+April","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34\/28210521.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64\/28210521.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/28210521.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/252\/28210521.png","size":"extralarge"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/_\/28210521\/Dead+by+April.png","size":"mega"}]}]},"tags":{"tag":[{"name":"rapcore","url":"http:\/\/www.last.fm\/tag\/rapcore"},{"name":"rap","url":"http:\/\/www.last.fm\/tag\/rap"},{"name":"hardcore","url":"http:\/\/www.last.fm\/tag\/hardcore"},{"name":"screamo","url":"http:\/\/www.last.fm\/tag\/screamo"},{"name":"emo","url":"http:\/\/www.last.fm\/tag\/emo"}]},"bio":{"published":"Thu, 28 Jul 2011 15:44:49 +0000","summary":"Hollywood Undead is an American rap rock band from Los Angeles, California. They released their debut album, Swan Songs, on September 2, 2008, and their live CD\/DVD Desperate Measures, on November 10, 2009. The band consists of Charlie Scene, Da Kurlzz, Funny Man, J-Dog, and Johnny 3 Tears. The band members use pseudonyms and wear masks to display a creative side, not to hide their identities as first assumed. They perform live without the masks on.  ","content":"Hollywood Undead is an American rap rock band from Los Angeles, California. They released their debut album, Swan Songs, on September 2, 2008, and their live CD\/DVD Desperate Measures, on November 10, 2009. The band consists of Charlie Scene, Da Kurlzz, Funny Man, J-Dog, and Johnny 3 Tears. The band members use pseudonyms and wear masks to display a creative side, not to hide their identities as first assumed. They perform live without the masks on.\n \n The band originated in 2005 from a song titled &quot;The Kids&quot; that Aron Erlichman (Deuce) and Jorel Decker (J-Dog) posted on the band's MySpace profile to positive reviews, leading them to form the group Hollywood Undead with their friends &quot;Shady&quot; Jeff Philips, George Ragan (Johnny 3 Tears), Jordon Terrell (Charlie Scene), Dylan Alvarez (Funny Man), and Matthew St. Claire (Da Kurlzz). In an interview with Shave magazine, J-Dog explained that when forming the band &quot;Whoever was in the room at the time and played an instrument was in the band.&quot;\n \n The band only took one year working on their debut album, Swan Songs. The other two years were spent looking for a company that wouldn't try to censor the album. They first signed a record contract with MySpace Records in 2005 but they left the label after the label tried to censor their first album. They then signed a contract with A&amp;M\/Octone Records and their first album, Swan Songs was released on September 2, 2008 and reached #22 on the Billboard 200 in its first week of release, selling 21,000 copies; which was later on released in the United Kingdom on May 18, 2009 with two bonus tracks. On June 23, 2009, Hollywood Undead released Swan Songs B-Sides EP through iTunes. After 64 weeks, the album fell off of the Billboard Top 200, but returned four weeks later at #174. Since then, it has gone in and out of the top 200, and is currently charting at #199. On July 28, 2009, it was certified gold by the RIAA.\n \n The band released a CD\/DVD set entitled Desperate Measures on November 10, 2009. The set includes a CD of six new songs, three of which being cover songs, as well as a previously unreleased remix of &quot;Everywhere I Go&quot;, and six live recordings of songs from Swan Songs, and a DVD of a full live performance by the band.The album debuted at #29 on the Billboard 200, #10 on Top Rock Albums, and #15 on Top Digital Albums.\n \n In early 2010, Deuce (Tha Produca) left the band. The reason for this is said to be either a feud between him and J3T which is what Deuces 'Story of a snitch' song suggest or he just wants to move on. He is now part of 9Lives.\n \n    \nUser-contributed text is available under the Creative Commons By-SA License and may also be available under the GNU FDL."}}});
    

    Sunday, November 18, 2012 11:59 PM

Answers

  • Hi,

    You could use winjs.xhr to access romote relative content.

     function CallData() {
            var person = { 'Name': 'Name'};
            WinJS.xhr({
                type: "POST",
                url: "http://www.xxx.com/WebService.asmx/method",
                headers: { "Content-type": "application/json" },
                data: JSON.stringify(person)
            }).then(function complete(request) {
                var resdata = request.responseText;
            }, function error(er) {
                var err = er.statusText;
            });
        }

    #WinJS.xhr function

    http://msdn.microsoft.com/en-us/library/windows/apps/br229787.aspx


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Samuel Hoffman Monday, November 19, 2012 6:48 AM
    Monday, November 19, 2012 1:57 AM