emonarafat / socialauth-net

Automatically exported from code.google.com/p/socialauth-net
0 stars 0 forks source link

Function not working with webservice #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This snippet is in my Business Logic Layer Class File:

Public Shared Function getAccIDFromSocialAuthSession() As Object
        Dim db As SqlDatabase = Connection.connection
        Dim accID As Integer
        If SocialAuthUser.IsLoggedIn Then
            Using cmd As SqlCommand = db.GetSqlStringCommand("SELECT AccountID FROM UserAccounts WHERE FBID=@fbID")
                db.AddInParameter(cmd, "fbID", SqlDbType.VarChar, SocialAuthUser.GetCurrentUser.GetProfile.ID)
                accID = db.ExecuteScalar(cmd)
            End Using
        End If

        Return accID
    End Function
I suppose SocialAuth.NET stores everything in session. For e.g to get the 
Facebook User ID i call SocialAuthUser.GetCurrentUser.GetProfile.ID , since it 
is session based i get this error message "Object Reference Not Set to an 
instance of an object" when i try to call 
SocialAuthUser.GetCurrentUser.GetProfile.ID from a webservice (asmx.vb) file. I 
am calling it like this 
(ClassName.FunctionName-->BLL.getAccIDFromSocialAuthSession)

Whaen i call the same function from a aspx.vb page it works fine but not when i 
call it from an asmx.vb page.

Since i do not know the session variable name , i cannot use 
System.Web.HttpContext.Current.Session("NameHere")

Any solution??

Original issue reported on code.google.com by monodee...@gmail.com on 29 Nov 2012 at 5:38

GoogleCodeExporter commented 9 years ago
Isn't anyone going to answer my question?? This is grave important. I request.

Original comment by monodee...@gmail.com on 29 Nov 2012 at 7:17

GoogleCodeExporter commented 9 years ago
Here's the answer.

http://stackoverflow.com/questions/13631410/function-not-working-with-webservice
/13631488#comment18699504_13631488

Original comment by monodee...@gmail.com on 29 Nov 2012 at 8:19

GoogleCodeExporter commented 9 years ago
Thanks for posting link

Original comment by deepak.a...@3pillarglobal.com on 14 Dec 2012 at 10:10