mercredi 29 juillet 2015

Http call issue on EC2 VM

I have a program hosted in EC2 machine. I appeal to the Google API shorts URL as follows:

string longUrl= PhoenixPokerConst.PrivatePartyServer+ PhoenixPokerConst.PrivatePartyPath+ Name;
StringContent stringContent = new StringContent("{ \"longUrl\": \""+longUrl+"\" }", Encoding.UTF8,"application/json");
var builder = new UriBuilder("http://ift.tt/SaMcy4") {Port = -1};
var query = HttpUtility.ParseQueryString(builder.Query);
query["key"] = PhoenixPokerConst.GoogleKey;
builder.Query = query.ToString();
string url = builder.ToString();
HttpClient client=new HttpClient();
client.PostAsync(url, stringContent).ContinueWith(task => GenerateShortURLResponse(task.Result));

It works fine on my development machine. When I run the program on the virtual machine there is not an error or exception but the call-back method is never called. To be sure it was not a security group problem, I opened all ports for all IP in and out. Does anyone have an idea of the problem?

Best Vincent




Aucun commentaire:

Enregistrer un commentaire