views:

32

answers:

0

Hello,

I am working on a single sign on sollution for two different websites. I am trying to make the methods in my customized(overriden) provider post to a web service and get the results from it so that the same login.

It works for most methods but there are ones that return System.We.Security sp3ecific objects that fail. For example

public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
    {
        System.Web.Security.MembershipUser mu = null;
        iConnect.Core.iConnectWS.iConnect connect = new iConnect.Core.iConnectWS.iConnect();
        mu = ((MembershipUser)connect.GetUser(providerUserKey, userIsOnline));
        return mu;
    }

is in the provider and it calls

[WebMethod(EnableSession = true)]
public object GetUser(object providerUserKey, bool userIsOnline)
{
    return (object) System.Web.Security.Membership.GetUser(providerUserKey, userIsOnline);
}

in the webservice (the webservice uses the default asp.net provider System.Web.Security.SqlMembershipProvider)

My problem is that when I try to run this I get an error

Unable to cast object of type 'iConnect.Core.iConnectWS.MembershipUser' to type 'System.Web.Security.MembershipUser'

If I don't make the web service return a object then I get this error at compilation.

The class is the web service and the one in the one in the provider is one and the same System.Web.Security.MembershipUser.

Can anyone help me? thank you in advance