none
Reading SSO Value from BTDF SSO Setting File Reader dll RRS feed

  • Question

  • Hi,

    I need to read the value inside the Map from SSO. since I am using BTDF,i am using SSOSettingsFileReader dll to read from SSO.

    So I have used a scripting Functoid to reference an External Method which is like below

      public static string WriteType(string mtlType,string sType )
             {
                 string BiType=null;
                 string SSOType2=null;
                 if (mtlType== "SUD" || mtlType== "SSV")
                 {
                   
                     SSOType2= SSOSettingsFileReader.ReadString("SSOSettings", sType );
    
                     if (string.IsNullOrEmpty(SSOType2))
                         BiType= null;
                     else
                         BiType= SSOItemType2;
                 }
                 return BiType;
             }

    It works fine when I have the Key value in SSO.I am able to get it in the Map. but if I don't have the Key In SSOSettings Application it throws an Error.

    For Example  if SType="Sujith" and I am not having that key in my SSO Application SSOSettings it throws an Error.

    Requested SSO value Sujith is not available within affiliate app at the below Statement

    SSOSettingsFileReader.ReadString("SSOSettings", sType );

    I am not sure how can I check whether the Key Exists first in SSO first and then take the value. I have checked the methods present in SSOSettingsFileReader, I don't think it has it.

    Can you help how I can achieve it?

    Thanks,

    Sujith.


    Wednesday, November 30, 2016 8:35 AM

Answers

  • Hi Sujith,

    That is as per functionality. However you can download the source code and modify it as per your requirement.

    Source code is available at: https://searchcode.com/codesearch/view/8765758/

    You will have to modify the below code as per your requirement and rebuild the solution.

    public static string ReadString(string affiliateApplication, string valueName)
    		{
    			Hashtable ht = Read(affiliateApplication);
    			string val = (string)ht[valueName];
    			
    			if(val == null && ExceptionOnNull)
    			{
    				throw(new ArgumentException(
    					string.Format("Requested SSO value {0} is not available within affiliate app {1}",
    					valueName==null?"empty":valueName,affiliateApplication),"valueName"));
    			}
    
    			return val;
    		}


    Rachit Sikroria (Microsoft Azure MVP)

    Wednesday, November 30, 2016 8:49 AM
    Moderator

All replies

  • Hi Sujith,

    That is as per functionality. However you can download the source code and modify it as per your requirement.

    Source code is available at: https://searchcode.com/codesearch/view/8765758/

    You will have to modify the below code as per your requirement and rebuild the solution.

    public static string ReadString(string affiliateApplication, string valueName)
    		{
    			Hashtable ht = Read(affiliateApplication);
    			string val = (string)ht[valueName];
    			
    			if(val == null && ExceptionOnNull)
    			{
    				throw(new ArgumentException(
    					string.Format("Requested SSO value {0} is not available within affiliate app {1}",
    					valueName==null?"empty":valueName,affiliateApplication),"valueName"));
    			}
    
    			return val;
    		}


    Rachit Sikroria (Microsoft Azure MVP)

    Wednesday, November 30, 2016 8:49 AM
    Moderator
  • Thanks Rachit,

    There is one method Read method which ill give us the HashTable. I used that and solved like u said above.

    Thanks,

    Sujith.

    Wednesday, November 30, 2016 2:03 PM