Hi,
I'm having some difficulty trying to ref. a user defined type in K2 Studio.Â
Â
In my webservice I have these user defined classes:
Â
public class ADMember
{
   public string username;
   public string firstname;
   public string lastname;
   public string employeeNumber;
}
public class ADMemberArr
{
   public ADMemberÂ] admemberArr;
}
Â
Â
My webservice has the ADMemberArr returning back:
public ADMemberArr GetMembers(string LDAPFilter)Â Â Â {
     ...
       return oADMemberArr;     Â
   }
Â
Â
In K2 Studio I have this in my code:
public void Main(ref DestinationRuleContext K2) {
  Â
   K2.ResolveQueuesToUsers = true;
  Â
   SourceCode.K2Utilities.DSHelper oDSH = new SourceCode.K2Utilities.DSHelper(SourceCode.K2Utilities.DSHelper.DSHelperNewOptionsEnum.DefaultLDAPDomain);
   System.DirectoryServices.DirectoryEntry oDEManager;
   string sManager;
   bool bAllTrue = true;
   CDest1 oDest1 = new CDest1();
   oDest1.Main(ref K2);
  Â
  Â
   ADService.ADService oADSvc = new ADService.ADService();
   ADService.ADMemberArr oADMemberArr = new ADService.ADMemberArr();
  Â
   ADService oWebService = new ADService();  Â
     Â
   try
   {  Â
      oWebService.Url = "http://teknck2stage/common/ADService.asmx";
      oWebService.Credentials = SourceCode.K2Utilities.GeneralMod.GetCredentials(oWebService.Url);
      object oADMemberArr = oWebService.GetMembers("tekDepartmentNumber=8031)");
                Â
      foreach(ADService.ADMember oADMember in oADMemberArr.admemberArr())
       {
         if (oDest1.IsSuccess == true) {
         //== sendto
            K2.Destinations.Add(DestinationType.User, oADMember.username);
        Â
            if (bAllTrue == false) return;
         }     Â
       }
     Â
   }
   catch (Exception ex)
   {
      throw ex;
   }
   finally
   {
      oWebService = null;
   }  Â
}
// Destination Classes
  Â
private class CDest1 {
   public bool IsSuccess = false;
     Â
   public void Main(ref DestinationRuleContext K2) {
      this.IsSuccess = true;
   }
}
Â
 However it does not compile nicely in K2 Studio... I get these errors saying it doesn't recognize the types.
 Line 13: The type name 'ADMemberArr' does not exist in the type 'ADService'
 Line 21: The type name 'ADMember' does not exist in the type 'ADService'Â
I think I'm referencing this wrong unlike in Visual Studio. Any idea how I can do this?
Â
Thanks,
Vinny
Â