views:

214

answers:

3

Hi,

I developed a simple ASP.NET app, it was working fine, but now I can't get user info; I am getting this message:

The remote server returned an error: (417) Expectation failed.

and here's the code I'm using:

Dim FBUser As Facebook.Schema.user = Nothing
Dim connectSession As Facebook.Session.ConnectSession
Dim FBApi As Api

connectSession = New Facebook.Session.ConnectSession(ConfigurationManager.AppSettings("AppKey"), ConfigurationManager.AppSettings("AppSecret"))

If connectSession.IsConnected() Then
    FBApi = New Api(connectSession)
    Try
        FBUser = FBApi.Users.GetInfo()
        '' do some work
    Catch ex As Exception
        FBUser = Nothing
        '' other work
    End Try
End If

This is really confusing, because it was just working fine for 2 weeks now !!

Thanks

A: 

I've been still getting same error in

facebookApi.Users.Getinfo()

and

facebookAPI.Fql.Query("SELECT name FROM user")

methods.

thanks

Fatih Samet ÇETİN
+1  A: 

Yeah, I developed an application using "Facebook.Session.ConnectSession", establishing it, then checking if I actually have a Facebook session. It worked great at first. But then it just stopped. Now, even when I'm logged into FB, making edits, my code refuses to see that I have a session established. It's a little maddening....I guess thats why most of the bigger sites using Facebook Connect are still in beta. I think FB is doing something on the back end.

Public Partial Class _Default Inherits System.Web.UI.Page Private Api As Facebook.Rest.Api Private connectSession As Facebook.Session.ConnectSession Protected Sub Page_Load(sender As Object, e As EventArgs) connectSession = New Facebook.Session.ConnectSession(ConfigurationManager.AppSettings("ApiKey"), ConfigurationManager.AppSettings("Secret")) If Not connectSession.IsConnected() Then

Response.Write("not connected")

Else Try Api = New Facebook.Rest.Api(connectSession) Dim u As Facebook.Schema.user = Api.Users.GetInfo() ...

A few days ago, this code would get to the "Else" section and begin processing additional code. Suddenly it stopped. Now all I get is "not connected". Weird.

In another forum I saw someone who stated something similar happened to them. They used a different API key and their code worked. If FB is disabling accounts, you'd think they'd send an email telling you why. Such is life....

David
+1  A: 

I'm sorry for posting the solution that late, but it turned out to be some ISP related stuff. Adding this line to web config will help:

  <system.net>
    <settings>
      <servicePointManager expect100Continue="false"/>
    </settings>
  </system.net>

Or it equivalent by code.

FearUs