public ObjectResult BuildChild(BuildOffnetChildServiceRequestWeb postData)
 {
     return(WebFunction.Execute <BuildOffnetChildServiceRequestWeb, OffnetHierarchyWeb>(this, postData, (req) =>
     {
         var key = new OffnetServiceKey(req.ParentService);
         var child = OffnetServiceHierarchy.BuildChild(key, req.Name);
         return new WebResult <OffnetHierarchyWeb>(child);
     }));
 }
        public void PomBuildChild()
        {
            //Assumes that service Id 3 has children
            Startup.LoadSettings();
            var key    = new BuildOffnetChildServiceRequestWeb();
            var parent = new OffnetServiceKeyWeb();

            parent.ServiceID     = 3;
            parent.Date          = DateTime.Now;
            parent.Attributes    = new OffnetAttrInstanceWeb[0];
            parent.ChildServices = new OffnetServiceCollectionWeb[0];
            parent.IsValid       = true;
            key.ParentService    = parent;
            key.Name             = "ASOG_UNI";
            var url       = FscApplication.Current.Settings.FscUrls.FSCMediation + MediationEndPoints.pomBuildChild;
            var hierarchy = ApiClient.Post <OffnetHierarchyWeb, BuildOffnetChildServiceRequestWeb>
                                (HttpTargetType.FSCMediation, "FSC Mediation Pom Serv BuildChild", url, key, ApiClient.ContentType.Json, ApiClient.HeaderType.FSCMediation);

            Assert.IsNotNull(hierarchy);
            Assert.IsTrue(hierarchy.Services.Length > 0);
        }