These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

EMMA and the new API

Author
Mark Androcius
#1 - 2012-04-16 10:22:03 UTC
I've got the complete source-code for EMMA ( don't know if any of you still know about this one ).
But it has a small, mediocre, giant, huge issue, i can't connect to the api serer.

I get the error (417) expectation failed.

And uhm, yeah, that's it.

Looking over the code, i can't see how any of the million changes i made, relate to the connection.
I do however think i found where the problem comes from.

if (!Globals.EveAPIDown)
{
request = (HttpWebRequest)HttpWebRequest.Create(url);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
ASCIIEncoding enc = new ASCIIEncoding();
data = enc.GetBytes(parameters);

try
{

Stream reqStream = request.GetRequestStream();
try
{
reqStream.Write(data, 0, data.Length);
}
finally
{
reqStream.Close();
}

response = (HttpWebResponse)request.GetResponse(); HERE, RESPONSE REMAINS NULL
}
catch (WebException webEx)
{
throw new EMMAEveAPIException(ExceptionSeverity.Error,
"Problem retrieving data from Eve web service", webEx);
}

Parameters for the "data" are correct, as i got the correct xml file in front of my nose, when pasting it into firefox, so i guess the request is not made correctly.

Is this to do with changes to the api server, or could i try something else?

Thanks,

Mark
Mark Androcius
#2 - 2012-04-16 10:37:53 UTC
Never mind, i fixed it.

Turns out i was right.

The url started with http://api.eveonline.com and it had to be https://api.eveonline.com, one character made all the difference.
Desmont McCallock
#3 - 2012-04-16 10:41:03 UTC  |  Edited by: Desmont McCallock
What's the URL you are using (without the request data)?

Edit: Was about to suggest that but wanted to be sure first. You beat me to it.
Mark Androcius
#4 - 2012-04-16 10:44:40 UTC  |  Edited by: Mark Androcius
Desmont McCallock wrote:
What's the URL you are using (without the request data)?

Edit: Was about to suggest that but wanted to be sure first. You beat me to it.


As said in my last post, or did you mean something else?

I haven't got any experience with the EVE api and i just started with networking, so some things could be a little vague to me or someone else.


Edit, big lol: double crossposting going on here :P
Desmont McCallock
#5 - 2012-04-16 10:49:23 UTC
lol. Wrote my answer before seeing your post. Edited after seeing it. Ain't those forums great ?!
Mark Androcius
#6 - 2012-04-16 10:54:20 UTC
btw, aren't you the dude, who kept EMMA up to date for a while? name looks familiar somehow.
Desmont McCallock
#7 - 2012-04-16 11:00:45 UTC
Nope. I'm the EVEMon dude.
Mark Androcius
#8 - 2012-04-16 11:21:26 UTC
Ah, so i did know your name from somewhere :P