| Author |
Topic  |
|
New Gamer

15 Posts |
Posted - Dec 09 2008 : 07:26:54 AM
|
Hi all,
I have been tying to consume some of the webservices provided, These work through a browser directly (tried IE, FF 2.0, and FF 3.0) but when I try to consume them through code for a website I get access denied.
Any ideas why?
I am a c# .net ecommerce developer but I am trying to learn classic ASP so consuming them with that.
Thanks.
|
DarkViper |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
|
New Gamer

15 Posts |
Posted - Dec 09 2008 : 09:16:57 AM
|
Hi the api was: 360voice.gamertag.profile
I dont have the code with me, but I know it works as I am currently using it to hit another sevice, the 360voice one was just better. I just get the access denied error page in the response. |
DarkViper |
 |
|

Fshguy
344,086
Zone: Recreation
Total games played:
868
Current Streak: 914
Longest Streak: 914
360voice Staff
    
USA
5284 Posts |
Posted - Dec 09 2008 : 09:23:33 AM
|
| I'm not sure, you're saying ASP, but I'm wondering if you're trying to access the api from a javascript? If that's the case, you have to create some type of proxy call to your host web site that calls. You can't call other websites from java easily. |
Needs more Cowbell!!!!! My Blog | Badge Calc | Voice Calendar  |
 |
|
New Gamer

15 Posts |
Posted - Dec 09 2008 : 10:13:49 AM
|
I am using Classic ASP VBScript, NOT Javascript. Im working late today so cant get my code from home to post, I will post it when I do get home though.
As Ive said the code works with another webservice, the one I am using currently (which is worthless at the least, as it contains very little info) is the one from xboxlivenation (hope im ok to name them here?)
Cheers, |
DarkViper |
 |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
Posted - Dec 09 2008 : 10:46:19 AM
|
sure i know the developer at XLN, and his web services.
In any event a code sample would be best as i cant think of anything specifically that would make the api not work, and actually it shouldnt matter what language you are consuming it in, if it works for anyone it should give you the same data when called as they are getting, which is why I dont think there is anything up with the API - but its worth checking :)
i dont know of anything specific that should cause the problem, as fish mentioned above a javascript to pull the data would cause that kind of error as it is from a different domain, etc. but we will help get it sorted.
when you get home if you dont want to post it you can mail it to me to review. If i get some time ill dig out some of my classic asp examples and validate that it works, or when you get a chance to get a hold of your code we can review it and see what could be up
 |
 *no squids were harmed in the creation or use of this gamertag Check out the latest Friendcast! | 360friendspot.com | Squidpunch.com | larrabeefamily.com | madden-stats.com
|
 |
|
New Gamer

15 Posts |
Posted - Dec 09 2008 : 11:18:21 AM
|
here is the code Im using. I dont mind sharing the code. Its not something Ive spent hours pouring over, its only a few lines. lol.
Dim myRSSfile, xmlHttp, myXML, xmlResponse, objHdl, objLst
myRSSfile = "http://www.360voice.com/api/gamertag-profile.asp?tag=darkv1p3r"
Set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlHttp.Open "Get", myRSSfile, false
xmlHttp.Send()
myXML = xmlHttp.ResponseText
Set xmlResponse = Server.CreateObject("MSXML.DOMDocument")
xmlResponse.async = false
xmlResponse.LoadXml(myXML)
Set rootNode = xmlResponse.documentElement
Im trying to learn Classic ASP, as Ive said im a .net developer but I dont have any real skills with the old languages, yet ;)
obviously I change the url to the one |
DarkViper |
 |
|

Fshguy
344,086
Zone: Recreation
Total games played:
868
Current Streak: 914
Longest Streak: 914
360voice Staff
    
USA
5284 Posts |
Posted - Dec 09 2008 : 12:11:17 PM
|
Well, COBOL and FORTRAN are a riot...
In any case, you mentioned vbscript, so is it running on the client or the server? |
Needs more Cowbell!!!!! My Blog | Badge Calc | Voice Calendar  |
 |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
Posted - Dec 09 2008 : 1:19:13 PM
|
ok i knew i had helped good old Fafhrdd on this very thing when he was first starting, i just had to dig around a bit to find his starting point and what i suggested, and change it up a bit - this should get you started, especially being a developer in other areas.
as you know there is always 'more than one way to skin a cat' but this is the way i generally would use an XML service in classic asp, when not using an XSL transform
<%
Dim objXML, url, source, nodes,daysplayed,recorddaysplayed
'this is our HTTP Object to request the data
set objXML = Server.CreateObject("Microsoft.XMLHTTP")
'the page we want to load
url = "http://www.360voice.com/api/gamertag-profile.asp?tag=darkv1p3r"
'open the request
objXML.Open "GET", url, false
'actually send the request
objXML.Send
'we want an xml object to work with
set source = Server.CreateObject("Microsoft.XMLDOM")
'load the data from the returned value of the HTTP GET request
source.async = false
source.load(objXML.ResponseXML)
'load the info node
set nodes = source.getElementsByTagName("info")
if nodes.length > 0 then
daysplayed = cint(nodes(0).getElementsByTagName("dayplayed")(0).text)
recorddaysplayed = cint(nodes(0).getElementsByTagName("recorddaysplayed")(0).text)
response.write "good job you played " & daysplayed & _
" days lets see if you can break that record " & _
"of " & recorddaysplayed & "!"
else
response.write "crash, boom, fail......"
end if
'cleanup
set objXML = nothing
set source = nothing
set nodes = nothing
%>
|
 *no squids were harmed in the creation or use of this gamertag Check out the latest Friendcast! | 360friendspot.com | Squidpunch.com | larrabeefamily.com | madden-stats.com
|
 |
|
New Gamer

15 Posts |
Posted - Dec 09 2008 : 3:51:59 PM
|
XSL transforms are nice and quick, but ive always been a stickler for throwing stuff into objects of my own :) Your code looks very like mind, but you have included the code for getting the data etc from the nodes, which I missed off the CopyNpaste lol. Ill give it a go tomorrow night, or might even try it out in work if I can sneak in :)
As for my VBScript is server side, if I was doing client side I go with javascript. I used to be a vb6 developer a few moons ago now, nothing professional all 3rd party apps, and then moved onto more pretend programming/development with .net. I tried c++ once, that was too much like hard work. lol.
Hopefully ill get these APIs working and produce a nice little site, which after thursday (as im learning classic ASP for an interview as they were concerned i didnt have classic ASP to maintain old legacy systems damn those fools) I will convert it over to .net and produce a decent site, as atm ive spent 0 time on design and markup.
/me looks at the url... oops classic asp forum... lol |
DarkViper |
 |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
Posted - Dec 09 2008 : 4:34:49 PM
|
i think the reall difference is
yours: Set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
mine: set objXML = Server.CreateObject("Microsoft.XMLHTTP")
i could look up the documentation but at one time i reviewed between these two and chose mine - i cant recall why it could have been i liked the lower number of letters to type, though i think its related to the fact that if i try your sample on my local IIS install on this laptop it gives the following results
HTTP Error 403.1 - Forbidden: Execute access is denied. Internet Information Services (IIS)
which is referring to execution of code rather than the access of the XML
i personally dont use XSL transforms much either - i had to get my feet wet and understand them as fatty and change have made quite a bit of use of them all over here with locations that we use xml data sources though - as you will see classic asp isnt very object driven so it fits 
|
 *no squids were harmed in the creation or use of this gamertag Check out the latest Friendcast! | 360friendspot.com | Squidpunch.com | larrabeefamily.com | madden-stats.com
|
 |
|
New Gamer

15 Posts |
Posted - Dec 10 2008 : 01:39:22 AM
|
Ah right cool, that looks like the error I am getting so Ill give that a go. I have no idea yet of all the objects for ASP, as Ive only been looking at it for a few hours after work.
a totally unrelated question, but is there a login class like in .net or is it all basic sql transactions? |
DarkViper |
 |
|
New Gamer

15 Posts |
Posted - Dec 10 2008 : 10:39:50 AM
|
Thank youSquidpunch, I take my hat off to you, Thanks for your help. That worked a treat, I just wonder why there are SO many different object for http requests and responses.
Cheers again |
DarkViper |
 |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
Posted - Dec 10 2008 : 12:06:35 PM
|
quote: Originally posted by DARKV1P3R
Ah right cool, that looks like the error I am getting so Ill give that a go. I have no idea yet of all the objects for ASP, as Ive only been looking at it for a few hours after work.
a totally unrelated question, but is there a login class like in .net or is it all basic sql transactions?
a login class for classic asp when going to a database? its more procedural....create connection object, create command object - use those to insert or return record set object. so many times in classic asp you would make an include file with a function to setup the work you want to do and return the results, and do the cleanup etc - rather than what you would normally expect an object to do, similar thing really except look at it as an object which has no other properties or functions the object instantiation is what returns your results rather than an object that you instance and work with to get your results which could be over other methods properties, etc....hopefully that makes sense.
there are many similarities to vb.net and classic asp, but its a bit different indeed.
i dabble with pretty much any area code i can get my hands on so things tend to blur at times - but i believe thats the proper flow of a database connection in classic asp
and in vb.net its similar if you do the connection yourself, connection, command object - and work with results and so forth.
they all kind of work a bit differently but I agree its kind of wacky to have so many different ones - i believe that the one you were trying is something server side, and as you can see with the error it can be restricted (and is by default on IIS today, but perhaps not in the past) so they probably made new objects to allow the same functionality to work on more strict setups - who knows really - but if it was perfect we wouldnt need .net 1.0, 2.0, 3.0.......you get the picture 
|
 *no squids were harmed in the creation or use of this gamertag Check out the latest Friendcast! | 360friendspot.com | Squidpunch.com | larrabeefamily.com | madden-stats.com
|
 |
|
New Gamer

15 Posts |
Posted - Dec 10 2008 : 1:30:28 PM
|
lol thanks for the insight. if possible I may drop you an email if I get really stuck with some with classic asp?
I have used a few langauges in the past, from vb5 and 6 vb.net, c#, JSP. Also dabbled with c++ and Java once or twice. But for the web IMO you cant beat a good c# website, nothing like pretend programming lol.
Thanks for your help so far Ive got the sample code working now, and also consumed the game list site, it will be live at some point tonight. Its nothing great just a few tests with little design or css work. Just to prove to this interview I can learn and I am proactive.
Cheers again, and if you want to view the site, id wait till tomorrow morning but its www.darkviper.co.uk
|
DarkViper |
 |
|

squidpunch
68,077
Zone: Recreation
Total games played:
Current Streak: 0
Longest Streak: 109
360voice Staff
    
USA
1509 Posts |
|
New Gamer

15 Posts |
Posted - Dec 11 2008 : 12:48:12 AM
|
lol Thanks, Google is a dear friend of mine as all my programming skills have come from there, more or less. Although I have started to study for the MCTS and MSCPD in .net
I've been thinking about XNA as a few of my friends did game design at uni, and I've done a lot of 3d modeling over the years for games like, UT and Half-lfe etc. We thought about trying to do a basic mod, nothing to sell just a proof of concept to prove we could do it, but alass nothing as of yet.
and my damned network manager hasnt uploaded my site, I knew I should have used my old hosting, lol. Gonna kick his ass when he gets in.
Cheers, |
DarkViper |
 |
|

Fshguy
344,086
Zone: Recreation
Total games played:
868
Current Streak: 914
Longest Streak: 914
360voice Staff
    
USA
5284 Posts |
Posted - Dec 12 2008 : 09:35:59 AM
|
Squid... that's just a shame....
I just went to a MSDN developer conference in Orlando...
Lots of way cool stuff here and right on the way... Stuff I need to dig into and learn!!!
In any case MS has its own AJAX library, they're working on dynamic data, called MVC(supposed to be the anti-ruby on rails). There's also Jquery... allows you to query your DOM and apply CSS tags and effects to your code client side, etc.
Oh, and they're integrating all this stuff in for intellisense..
Not sure if I'm buying into Silverlight yet(flash equiv?), but some things are coming that look pretty interesting too.
There's a lot of this code and examples here... http://www.codeplex.com/ |
Needs more Cowbell!!!!! My Blog | Badge Calc | Voice Calendar  |
 |
|
New Gamer

15 Posts |
Posted - Dec 13 2008 : 02:37:17 AM
|
I've heard some good things about JScript but not had a look at it much myself, also I think silverlight has a few revisions to go before its viable. The new version apparently has a lot of the rendering issues and bugs fixed, but its still early days, hopefully it wont get over used like flash was and then take 10years to find its rightful place as adverts and little games, lol. But I think silverlight offers a lot more to .net developers than flash ever did.
As for the interview I was learning asp for, it got cancelled nd they took on a someone else before even seeing me, but saved me some fuel I suppose, still got a second interview next friday. hopefuly that one will come up.
As for Jscript are the integrating that into VS? I think they should integrate fully with Resharper, its the best addon for VS Ive seen, although u need a decent machine to run it with any effect, I cant code without it now lol.
Well so no more Classic ASP I think Ill spend some time developing the site in c# instead, and maybe even use some of the apis here to create something new.
Is it too late to get access to the original M$ apis?
Cheers |
DarkViper |
 |
|
New Gamer

15 Posts |
Posted - Dec 13 2008 : 08:11:35 AM
|
| JScript? I mean JQuery... :$ |
DarkViper |
 |
|
| |
Topic  |
|