WCF - Switching Company and Plant

Does anyone know how I can switch company and plant using WCF? I see there’s a SessionMod.svc, but I can’t seem to get it to do the switch with this:

        using (SessionModSvc.SessionModSvcContractClient client = new SessionModSvc.SessionModSvcContractClient())
            client.ClientCredentials.UserName.UserName = "manager";
            client.ClientCredentials.UserName.Password = "manager";

            string strTemp = "";
            client.SetCompany("Company2", out strTemp, out strTemp, out strTemp, out strTemp, out strTemp, out strTemp, out strTemp, out strTemp);



What am I doing wrong?

You need to pass in a CallContext header. (That’s the easiest way)
Instantiate this puppy

using System.Runtime.Serialization;
public interface ICallHeader
string Name { get; }
string Namespace { get; }
public class CallSettings : ICallHeader
private CallSettings()
public CallSettings(string company, string plant, string language, string formatCulture)
this.Company = company;
this.Plant = plant;
this.Language = language;
this.FormatCulture = formatCulture;
public string Company { get; set; }
public string FormatCulture { get; set; }
public string Language { get; set; }
public string Name =>
public string Namespace =>
public string Plant { get; set; }
public short? TimezoneOffset { get; set; }

And pass it in as a header. With the Key of “CallSettings”