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
23
Views
2
Comments
edited Jun 8, 2022 12:09PM in General Technical Discussions 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));
            

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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