How do I set an IGlobalContext variable
Content
Hello,
I'm trying to get the below example code working, I know _globalContext is of type IGlobalContext and I am declaring that, but how do I go about setting it initially? I am trying to create a WorkspaceRibbonButton Add-In if that makes a difference.
Thank you
Version
18DCode Snippet
EndpointAddress endPointAddr = new EndpointAddress(_globalContext.GetInterfaceServiceUrl(ConnectServiceType.Soap)); // Minimum required BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential); binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName; // Optional depending upon use cases binding.MaxReceivedMessageSize = 1024 * 1024; binding.MaxBufferSize = 1024 * 1024; binding.MessageEncoding = WSMessageEncoding.Mtom; // Create client proxy class RightNowSyncPortClient client = new RightNowSyncPortClient(binding, endPointAddr); // Ask the client to not send the timestamp BindingElementCollection elements = client.Endpoint.Binding.CreateBindingElements(); elements.Find<SecurityBindingElement>().IncludeTimestamp = false; client.Endpoint.Binding = new CustomBinding(elements); // Ask the Add-In framework the handle the session logic _globalContext.PrepareConnectSession(client.ChannelFactory); // Go do what you need to do! ClientInfoHeader cih = new ClientInfoHeader(); cih.AppID = "SAML Test";
0