tags:

views:

103

answers:

1

Briefly, I have been given a custom soap header class CustomHeader that contains a string representing the user's security token.

    public string UserInfo {
        get {
            return this.userInfoField;
        }
        set {
            this.userInfoField = value;
        }
    }

I have two webservices that both use the same CustomHeader but because they are in different assemblies I cannot cast from one to the other.

What I am trying to do is have a single instance of the CustomHeader that contains the user's token and then dependency inject the header using Funq. At some point in time the user's security token expires and I need to store the new one in the same CustomHeader and then reference that when calling the web services.

Any assistance would be much appreciated.

+1  A: 

Why do you have two copies in different assemblies? Why not create a common class in a library that both web services can reference? Then you won't have any incompatibility problems. I can't say I know Funq, but it would at least remove that issue (as well as making life generally simpler and more consistent).

Jon Skeet
Jon, I wonder if this is a proxy class issue?
John Saunders
@John: We'll have to see whether the OP comes back to let us know...
Jon Skeet