You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Passing the credentials in ServerConfigProperty

Received Response
21
Views
2
Comments
edited Mar 4, 2020 1:41PM in Integrations and APIs 2 comments

Summary

Can we access the ServerConfigProperty values outside the addin factory class?

Content

Hi friends,

I have used the ServerConfigProperty to get login credentials for SOAP wsdl from add-in manager. I am able to get these values in workspace add-in class where I have set up factory components. But how do I pass these to a helper class where I am connecting to service cloud soap wsdl ? Any help would be appreciated.

Below is the code for both the classes:

I want to send the values for wsdlUsername and wsdlPassword.

 

Version

19C

Code Snippet

WorkspaceAddin.cs>>>>>
[ServerConfigProperty(DefaultValue = "username")]
		public string WSDLUsername
		{
			get { return _add_in_username;  }
			set { _add_in_username = value; }
		}
		[ServerConfigProperty(DefaultValue = "password")]
		public string WSDLPassword
		{
			get { return _wsdl_pass; }
			set { _wsdl_pass = value; }
		}

RightNowSoapHelper.cs>>>>

public RightNowSoapHelper()
        {   
	      
                   BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
		   binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
		   binding.MessageEncoding = WSMessageEncoding.Mtom;
     EndpointAddress endPointAddr = new EndpointAddress(WorkspaceAddIn._globalContext.GetInterfaceServiceUrl(ConnectServiceType.Soap));
            
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!