شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة ش.ش.و.

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Ims

Public general use code classes and xml files that we've compiled and used over the years:

Optical Fiber Network's Operations Support System Management Intranet (OFN OSS) client support class for Nokia's Optical Fiber Network (OFN) client model.

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.IO;
   4:  using System.Net;
   5:  using System.Xml;
   6:   
   7:  namespace Ia.Ngn.Cl.Model.Client.Nokia
   8:  {
   9:      ////////////////////////////////////////////////////////////////////////////
  10:   
  11:      /// <summary publish="true">
  12:      /// Optical Fiber Network's Operations Support System Management Intranet (OFN OSS) client support class for Nokia's Optical Fiber Network (OFN) client model.
  13:      /// </summary>
  14:      /// 
  15:      /// <remarks> 
  16:      /// Copyright © 2014-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
  17:      ///
  18:      /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
  19:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  20:      ///
  21:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  22:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  23:      /// 
  24:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  25:      /// 
  26:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  27:      /// </remarks> 
  28:      public class Ims
  29:      {
  30:          private static bool success;
  31:          private static string sessionId, commandInLower, requestId, switchName;
  32:   
  33:          ////////////////////////////////////////////////////////////////////////////
  34:   
  35:          /// <summary>
  36:          /// 1360 COM WebAPI User Guide
  37:          /// </summary>
  38:          public enum ResultCode
  39:          {
  40:              Successful = 0, // added by me
  41:              SuccessfulButNoParameters = 100000, // added by me
  42:              DocumentElementIsNull = 100001, // added by me
  43:              Null = 100002, // added by me
  44:              MaximumCombinedNumberOfAgcfGatewayRecordsInAnyMgcIpAndMgcSecondaryIpPairIsExceeded = 100003, // added by me
  45:              PlxServiceNoConnectionToSwitch = 1,
  46:              PlxServiceInvalidObjectId = 2,
  47:              PlxServiceConnectFailure = 3,
  48:              PlxServiceObjectDoesNotExist = 4,
  49:              PlxNeResponseFailure = 5,
  50:              PlxInvalidOperation = 6,
  51:              PlxInvalidTid = 7,
  52:              PlxSwitchConnectFailed = 8,
  53:              PlxSwitchNotManaged = 9,
  54:              PlxSwitchNoActiveConnection = 10,
  55:              PlxInvalidTl1MetaProcessing = 11,
  56:              PlxSwitchVersionMismatch = 13,
  57:              PlxInvalidRegularExpression = 14,
  58:              PlxInvalidRange = 15,
  59:              PlxFileIoError = 17,
  60:              PlxXmlError = 18,
  61:              PlxTransientState = 19,
  62:              PlxUnableToPerformOperation = 21,
  63:              PlxMaxConfigurationExceeded = 22,
  64:              PlxNotSupported = 23,
  65:              PlxReqParameterNotSet = 24,
  66:              PlxCongestionControlRequestTimeout = 26,
  67:              PlxCongestionControlCongestionDetected = 27,
  68:              PlxDbRequestFailure = 10001,
  69:              PlxDbLoginFailure = 10002,
  70:              PlxUserPrivViolation = 10202,
  71:              PlxInvalidIp = 20002,
  72:              PlxInvalidNetworkIp = 20003,
  73:              PlxDuplicateName = 20006,
  74:              PlxInvalidPortId = 20008,
  75:              PlxUnableToAddDuplicate = 20011,
  76:              PlxUnableToDeleteChildrenExist = 20012,
  77:              PlxMustDeleteAclFirst = 20013,
  78:              PlxFailure = 20014,
  79:              PlxSyncFailure = 20015,
  80:              PlxOeNotSupported = 20016,
  81:              PlxInvalidCharsInName = 20017,
  82:              PlxSwitchEmUsernameInvalidChars = 20108,
  83:              PlxSwitchEmPasswordInvalidChars = 20110,
  84:              PlxSwitchCannotModifyName = 20121,
  85:              PlxRouteInvalidNameLen = 20804,
  86:              PlxRouteInvalidNameChars = 20805,
  87:              PlxRouteInvalidRouteId = 20806,
  88:              PlxRouteInvalidRoutePriority = 20807,
  89:              PlxNumberInvalidNpa = 21901,
  90:              PlxNumberInvalidNxx = 21902,
  91:              PlxInvalidSubscriberId = 22200,
  92:              PlxInvalidSubscriberPicCode = 22201,
  93:              PlxInvalidSubscriberStatus = 22204,
  94:              WebApiFailure = 30000,
  95:              SessionInvalid = 30001,
  96:              SessionTimedOut = 30002,
  97:              RequestTimedOut = 30003,
  98:              PlxCtsUnknownError = 50000,
  99:              PlxCtsErrorDbUnavail = 50001,
 100:              PlxCtsErrorDbError = 50002,
 101:              PlxCtsErrorDataInvalid = 50003,
 102:              PlxCtsErrorDataReplication = 50004,
 103:              PlxCtsErrorNodataFound = 50005,
 104:              PlxCtsErrorUnauthorized = 50006,
 105:              PlxCtsErrorRetryLater = 50007,
 106:              PlxCtsErrorOverload = 50008,
 107:              PlxCtsErrorDuplicateKey = 50009,
 108:              PlxCtsErrorVersionMismatch = 50010,
 109:              PlxCtsErrorUpdateLogOverrun = 50011,
 110:              PlxCtsErrorUnexpectedState = 50012
 111:          }
 112:   
 113:          ////////////////////////////////////////////////////////////////////////////
 114:   
 115:          /// <summary>
 116:          ///
 117:          /// </summary>
 118:          public Ims()
 119:          {
 120:              // below: trust all certificates
 121:              // below: see http://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel
 122:   
 123:              System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);
 124:              //ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
 125:   
 126:              System.Net.ServicePointManager.Expect100Continue = true;
 127:              //System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
 128:              //System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
 129:              System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
 130:          }
 131:   
 132:          ////////////////////////////////////////////////////////////////////////////
 133:   
 134:          /// <summary>
 135:          ///
 136:          /// </summary>
 137:          public string SessionId
 138:          {
 139:              get { return sessionId; }
 140:          }
 141:   
 142:          ////////////////////////////////////////////////////////////////////////////
 143:   
 144:          /// <summary>
 145:          ///
 146:          /// </summary>
 147:          public void ActUser(out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 148:          {
 149:              XmlDocument soapResultEnvelopeXmlDocument;
 150:   
 151:              SendSoapRequestAndReadResponse(ActUserSoapEnvelopeXml(sessionId), out soapResultEnvelopeXmlDocument);
 152:   
 153:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 154:          }
 155:   
 156:          ////////////////////////////////////////////////////////////////////////////
 157:   
 158:          /// <summary>
 159:          ///
 160:          /// </summary>
 161:          public void CancUser(out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 162:          {
 163:              XmlDocument soapResultEnvelopeXmlDocument;
 164:   
 165:              SendSoapRequestAndReadResponse(CancUserSoapEnvelopeXml(sessionId), out soapResultEnvelopeXmlDocument);
 166:   
 167:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 168:          }
 169:   
 170:          /*
 171:          ////////////////////////////////////////////////////////////////////////////
 172:          ////////////////////////////////////////////////////////////////////////////
 173:  
 174:          /// <summary>
 175:          ///
 176:          /// </summary>
 177:          public void EntNgfsAgcfGatewayRecordV2(int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 178:          {
 179:              int tableId;
 180:              List<Dictionary<string, string>> parameterDictionaryList;
 181:              XmlDocument soapResultEnvelopeXmlDocument;
 182:  
 183:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 184:  
 185:              SendSoapRequestAndReadResponse(EntNgcfAgcfGatewayRecordV2SoapEnvelopeXml(tableId, gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 186:  
 187:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out resultCode);
 188:          }
 189:          */
 190:   
 191:          ////////////////////////////////////////////////////////////////////////////
 192:   
 193:          /// <summary>
 194:          ///
 195:          /// </summary>
 196:          public Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord RtrvNgfsAgcfGatewayRecordV2(int gwId, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 197:          {
 198:              XmlDocument soapResultEnvelopeXmlDocument;
 199:   
 200:              return RtrvNgfsAgcfGatewayRecordV2(gwId, out soapResultEnvelopeXmlDocument, out response);
 201:          }
 202:   
 203:          ////////////////////////////////////////////////////////////////////////////
 204:   
 205:          /// <summary>
 206:          ///
 207:          /// </summary>
 208:          public Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord RtrvNgfsAgcfGatewayRecordV2(int gwId, out XmlDocument soapResultEnvelopeXmlDocument, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 209:          {
 210:              int tableId;
 211:              Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord agcfGatewayRecord;
 212:   
 213:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 214:   
 215:              SendSoapRequestAndReadResponse(RtrvNgcfAgcfGatewayRecordV2SoapEnvelopeXml(tableId, gwId, sessionId), out soapResultEnvelopeXmlDocument);
 216:   
 217:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 218:   
 219:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 220:              {
 221:                  agcfGatewayRecord = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayRecord.ParseFromDictionary(response.ParameterDictionaryList[0]);
 222:              }
 223:              else agcfGatewayRecord = null;
 224:   
 225:              return agcfGatewayRecord;
 226:          }
 227:   
 228:          ////////////////////////////////////////////////////////////////////////////
 229:   
 230:          /// <summary>
 231:          ///
 232:          /// </summary>
 233:          public Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecordTemp RtrvNgfsAgcfGatewayRecordFromSkbV2(int gwId, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 234:          {
 235:              XmlDocument soapResultEnvelopeXmlDocument;
 236:   
 237:              return RtrvNgfsAgcfGatewayRecordFromSkbV2(gwId, out soapResultEnvelopeXmlDocument, out response);
 238:          }
 239:   
 240:          ////////////////////////////////////////////////////////////////////////////
 241:   
 242:          /// <summary>
 243:          /// Read from SKB side
 244:          /// </summary>
 245:          public Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecordTemp RtrvNgfsAgcfGatewayRecordFromSkbV2(int gwId, out XmlDocument soapResultEnvelopeXmlDocument, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 246:          {
 247:              int tableId;
 248:              Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecordTemp agcfGatewayRecord;
 249:   
 250:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 251:   
 252:              SendSoapRequestAndReadResponse(RtrvNgcfAgcfGatewayRecordFromSkbV2SoapEnvelopeXml(tableId, gwId, sessionId), out soapResultEnvelopeXmlDocument);
 253:   
 254:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 255:   
 256:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 257:              {
 258:                  agcfGatewayRecord = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayRecordTemp.ParseFromDictionary(response.ParameterDictionaryList[0]);
 259:              }
 260:              else agcfGatewayRecord = null;
 261:   
 262:              return agcfGatewayRecord;
 263:          }
 264:   
 265:          ////////////////////////////////////////////////////////////////////////////
 266:   
 267:          /// <summary>
 268:          ///
 269:          /// </summary>
 270:          public void DltNgfsAgcfGatewayRecordV2(int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 271:          {
 272:              int tableId;
 273:              XmlDocument soapResultEnvelopeXmlDocument;
 274:   
 275:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 276:   
 277:              SendSoapRequestAndReadResponse(DltNgcfAgcfGatewayRecordV2SoapEnvelopeXml(tableId, gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 278:   
 279:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 280:          }
 281:   
 282:          ////////////////////////////////////////////////////////////////////////////
 283:          ////////////////////////////////////////////////////////////////////////////
 284:   
 285:          /// <summary>
 286:          ///
 287:          /// </summary>
 288:          public void EntNgfsAgcfGwCombinedRecV2(int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont ont, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 289:          {
 290:              bool isExceeded;
 291:              int tableId;
 292:              XmlDocument soapResultEnvelopeXmlDocument;
 293:   
 294:              response = new Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response();
 295:   
 296:              // check if the number of AGCF gateway records for the MGC primary and secondary IP pair does not exceed the maximum recommended by Nokia
 297:   
 298:              isExceeded = Ia.Ngn.Cl.Model.Business.Nokia.Ims.MaximumCombinedNumberOfAgcfGatewayRecordsInAnyMgcIpAndMgcSecondaryIpPairIsExceeded(ont.MgcIp);
 299:   
 300:              if (!isExceeded)
 301:              {
 302:                  tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 303:   
 304:                  SendSoapRequestAndReadResponse(EntNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(tableId, gwId, ont, sessionId), out soapResultEnvelopeXmlDocument);
 305:   
 306:                  ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 307:              }
 308:              else
 309:              {
 310:                  response.ResultCode = Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.MaximumCombinedNumberOfAgcfGatewayRecordsInAnyMgcIpAndMgcSecondaryIpPairIsExceeded;
 311:              }
 312:          }
 313:   
 314:          ////////////////////////////////////////////////////////////////////////////
 315:   
 316:          /// <summary>
 317:          ///
 318:          /// </summary>
 319:          public void EdNgfsAgcfGatewayRecordV2_MateExternalIPAddr(int gwId, string mateExternalIPAddr, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 320:          {
 321:              int tableId;
 322:              XmlDocument soapResultEnvelopeXmlDocument;
 323:   
 324:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 325:   
 326:              SendSoapRequestAndReadResponse(EdNgfsAgcfGatewayRecordV2_MateExternalIPAddrSoapEnvelopeXml(tableId, gwId, mateExternalIPAddr, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 327:   
 328:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 329:          }
 330:   
 331:          ////////////////////////////////////////////////////////////////////////////
 332:   
 333:          /// <summary>
 334:          ///
 335:          /// </summary>
 336:          public void EdNgfsAgcfGatewayRecordV2_MateSite(int gwId, int mateSite, string primarySwitch, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 337:          {
 338:              int tableId;
 339:              XmlDocument soapResultEnvelopeXmlDocument;
 340:   
 341:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 342:   
 343:              SendSoapRequestAndReadResponse(EdNgfsAgcfGatewayRecordV2_MateSiteSoapEnvelopeXml(tableId, gwId, mateSite, primarySwitch, sessionId), out soapResultEnvelopeXmlDocument);
 344:   
 345:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 346:          }
 347:   
 348:          ////////////////////////////////////////////////////////////////////////////
 349:   
 350:          /// <summary>
 351:          ///
 352:          /// </summary>
 353:          public void EdNgfsAgcfGatewayRecordV2_IP1(int gwId, string ip1, string primarySwitch, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 354:          {
 355:              int tableId;
 356:              XmlDocument soapResultEnvelopeXmlDocument;
 357:   
 358:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 359:   
 360:              SendSoapRequestAndReadResponse(EdNgfsAgcfGatewayRecordV2_IP1SoapEnvelopeXml(tableId, gwId, ip1, primarySwitch, sessionId), out soapResultEnvelopeXmlDocument);
 361:   
 362:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 363:          }
 364:   
 365:          ////////////////////////////////////////////////////////////////////////////
 366:   
 367:          /// <summary>
 368:          ///
 369:          /// </summary>
 370:          public void DltNgfsAgcfGwCombinedRecV2(int gwId, string primarySwitch, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 371:          {
 372:              XmlDocument soapResultEnvelopeXmlDocument;
 373:   
 374:              DltNgfsAgcfGwCombinedRecV2(gwId, primarySwitch, out soapResultEnvelopeXmlDocument, out response);
 375:          }
 376:   
 377:          ////////////////////////////////////////////////////////////////////////////
 378:   
 379:          /// <summary>
 380:          ///
 381:          /// </summary>
 382:          public void DltNgfsAgcfGwCombinedRecV2(int gwId, string primarySwitch, out XmlDocument soapResultEnvelopeXmlDocument, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 383:          {
 384:              int tableId;
 385:   
 386:              tableId = Ia.Ngn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
 387:   
 388:              SendSoapRequestAndReadResponse(DltNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(tableId, gwId, primarySwitch, sessionId), out soapResultEnvelopeXmlDocument);
 389:   
 390:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 391:          }
 392:   
 393:          ////////////////////////////////////////////////////////////////////////////
 394:          ////////////////////////////////////////////////////////////////////////////
 395:   
 396:          /// <summary>
 397:          ///
 398:          /// </summary>
 399:          public void EntNgfsAgcfEndpointV2(string service, int gwId, int flatTermId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 400:          {
 401:              XmlDocument soapResultEnvelopeXmlDocument;
 402:   
 403:              SendSoapRequestAndReadResponse(EntNgfsAgcfEndpointV2SoapEnvelopeXml(service, gwId, flatTermId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 404:   
 405:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 406:          }
 407:   
 408:          ////////////////////////////////////////////////////////////////////////////
 409:   
 410:          /// <summary>
 411:          ///
 412:          /// </summary>
 413:          public List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> RtrvNgfsAgcfEndpointV2(string prividUser, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 414:          {
 415:              XmlDocument soapResultEnvelopeXmlDocument;
 416:              List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> agcfEndpointList;
 417:   
 418:              SendSoapRequestAndReadResponse(RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(prividUser, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 419:   
 420:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 421:   
 422:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 423:              {
 424:                  agcfEndpointList = Ia.Ngn.Cl.Model.Business.Nokia.AgcfEndpoint.ParseFromDictionary(response.ParameterDictionaryList);
 425:              }
 426:              else agcfEndpointList = null;
 427:   
 428:              return agcfEndpointList;
 429:          }
 430:   
 431:          ////////////////////////////////////////////////////////////////////////////
 432:   
 433:          /// <summary>
 434:          ///
 435:          /// </summary>
 436:          public List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> RtrvNgfsAgcfEndpointV2List(int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 437:          {
 438:              XmlDocument soapResultEnvelopeXmlDocument;
 439:              List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> agcfEndpointList;
 440:   
 441:              SendSoapRequestAndReadResponse(RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 442:   
 443:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 444:   
 445:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 446:              {
 447:                  agcfEndpointList = Ia.Ngn.Cl.Model.Business.Nokia.AgcfEndpoint.ParseFromDictionary(response.ParameterDictionaryList);
 448:              }
 449:              else agcfEndpointList = null;
 450:   
 451:              return agcfEndpointList;
 452:          }
 453:   
 454:          ////////////////////////////////////////////////////////////////////////////
 455:   
 456:          /// <summary>
 457:          ///
 458:          /// </summary>
 459:          public List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> RtrvNgfsAgcfEndpointV2List(int gwId, string primarySwitch, int imsService, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 460:          {
 461:              XmlDocument soapResultEnvelopeXmlDocument;
 462:              List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> agcfEndpointList;
 463:   
 464:              SendSoapRequestAndReadResponse(RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(gwId, primarySwitch, imsService, sessionId), out soapResultEnvelopeXmlDocument);
 465:   
 466:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 467:   
 468:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 469:              {
 470:                  agcfEndpointList = Ia.Ngn.Cl.Model.Business.Nokia.AgcfEndpoint.ParseFromDictionary(response.ParameterDictionaryList);
 471:              }
 472:              else agcfEndpointList = null;
 473:   
 474:              return agcfEndpointList;
 475:          }
 476:   
 477:          ////////////////////////////////////////////////////////////////////////////
 478:   
 479:          /// <summary>
 480:          ///
 481:          /// </summary>
 482:          public void EdNgfsAgcfEndpointV2_CallWaiting(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool serviceAssigned, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 483:          {
 484:              XmlDocument soapResultEnvelopeXmlDocument;
 485:   
 486:              SendSoapRequestAndReadResponse(EdNgfsAgcfEndpointV2SoapEnvelopeXml_CallWaiting(service, nddOnt, serviceAssigned, sessionId), out soapResultEnvelopeXmlDocument);
 487:   
 488:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 489:          }
 490:   
 491:          ////////////////////////////////////////////////////////////////////////////
 492:   
 493:          /// <summary>
 494:          ///
 495:          /// </summary>
 496:          public void DltNgfsAgcfEndpointV2(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 497:          {
 498:              XmlDocument soapResultEnvelopeXmlDocument;
 499:   
 500:              SendSoapRequestAndReadResponse(DltNgfsAgcfEndpointV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 501:   
 502:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 503:          }
 504:   
 505:          ////////////////////////////////////////////////////////////////////////////
 506:   
 507:          /// <summary>
 508:          ///
 509:          /// </summary>
 510:          public void DltNgfsAgcfEndpointV2(string service, string primarySwitch, string fsdb, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 511:          {
 512:              XmlDocument soapResultEnvelopeXmlDocument;
 513:   
 514:              SendSoapRequestAndReadResponse(DltNgfsAgcfEndpointV2SoapEnvelopeXml(service, primarySwitch, fsdb, sessionId), out soapResultEnvelopeXmlDocument);
 515:   
 516:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 517:          }
 518:   
 519:          /*
 520:          ////////////////////////////////////////////////////////////////////////////
 521:          ////////////////////////////////////////////////////////////////////////////
 522:  
 523:          /// <summary>
 524:          ///
 525:          /// </summary>
 526:          public void EntNgfsSubPartyV2(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 527:          {
 528:              // Not used. Subparty is created and deleted with subscriber
 529:              XmlDocument soapResultEnvelopeXmlDocument;
 530:  
 531:              SendSoapRequestAndReadResponse(EntNgfsSubPartyV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 532:  
 533:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 534:          }
 535:          */
 536:   
 537:          ////////////////////////////////////////////////////////////////////////////
 538:   
 539:          /// <summary>
 540:          ///
 541:          /// </summary>
 542:          public Ia.Ngn.Cl.Model.Nokia.SubParty RtrvNgfsSubPartyV2(string partyId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 543:          {
 544:              XmlDocument soapResultEnvelopeXmlDocument;
 545:              Ia.Ngn.Cl.Model.Nokia.SubParty subParty;
 546:   
 547:              SendSoapRequestAndReadResponse(RtrvNgfsSubPartyV2SoapEnvelopeXml(partyId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 548:   
 549:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 550:   
 551:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 552:              {
 553:                  subParty = Ia.Ngn.Cl.Model.Business.Nokia.SubParty.ParseFromDictionary(response.ParameterDictionaryList[0]);
 554:              }
 555:              else subParty = null;
 556:   
 557:              return subParty;
 558:          }
 559:   
 560:          ////////////////////////////////////////////////////////////////////////////
 561:   
 562:          /// <summary>
 563:          ///
 564:          /// </summary>
 565:          public Ia.Ngn.Cl.Model.Nokia.SubParty RtrvNgfsSubPartyV2(string partyId, string primarySwitch, int imsService, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 566:          {
 567:              XmlDocument soapResultEnvelopeXmlDocument;
 568:              Ia.Ngn.Cl.Model.Nokia.SubParty subParty;
 569:   
 570:              SendSoapRequestAndReadResponse(RtrvNgfsSubPartyV2SoapEnvelopeXml(partyId, primarySwitch, imsService, sessionId), out soapResultEnvelopeXmlDocument);
 571:   
 572:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 573:   
 574:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 575:              {
 576:                  subParty = Ia.Ngn.Cl.Model.Business.Nokia.SubParty.ParseFromDictionary(response.ParameterDictionaryList[0]);
 577:              }
 578:              else subParty = null;
 579:   
 580:              return subParty;
 581:          }
 582:   
 583:          ////////////////////////////////////////////////////////////////////////////
 584:   
 585:          /// <summary>
 586:          ///
 587:          /// </summary>
 588:          public void DltNgfsSubPartyV2(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 589:          {
 590:              // Not used. Subparty is created and deleted with subscriber
 591:              XmlDocument soapResultEnvelopeXmlDocument;
 592:   
 593:              SendSoapRequestAndReadResponse(DltNgfsSubPartyV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 594:   
 595:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 596:          }
 597:   
 598:          ////////////////////////////////////////////////////////////////////////////
 599:          ////////////////////////////////////////////////////////////////////////////
 600:   
 601:          /// <summary>
 602:          ///
 603:          /// </summary>
 604:          public void EntNgfsSubscriberAndNgfsSubPartyV2_H248(string service, int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 605:          {
 606:              bool isSip;
 607:              XmlDocument soapResultEnvelopeXmlDocument;
 608:   
 609:              isSip = false; // this is not SIP
 610:   
 611:              SendSoapRequestAndReadResponse(EntNgfsSubscriberV2SoapEnvelopeXml(service, isSip, gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 612:   
 613:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 614:          }
 615:   
 616:          ////////////////////////////////////////////////////////////////////////////
 617:   
 618:          /// <summary>
 619:          ///
 620:          /// </summary>
 621:          public void EntNgfsSubscriberAndNgfsSubPartyV2_Sip(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 622:          {
 623:              bool isSip;
 624:              XmlDocument soapResultEnvelopeXmlDocument;
 625:   
 626:              isSip = true; // this is SIP
 627:   
 628:              SendSoapRequestAndReadResponse(EntNgfsSubscriberV2SoapEnvelopeXml(service, isSip, 0, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 629:   
 630:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 631:          }
 632:   
 633:          ////////////////////////////////////////////////////////////////////////////
 634:   
 635:          /// <summary>
 636:          ///
 637:          /// </summary>
 638:          public Ia.Ngn.Cl.Model.Nokia.Subscriber RtrvNgfsSubscriberV2(string aid, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 639:          {
 640:              XmlDocument soapResultEnvelopeXmlDocument;
 641:              Ia.Ngn.Cl.Model.Nokia.Subscriber subscriber;
 642:   
 643:              SendSoapRequestAndReadResponse(RtrvNgfsSubscriberV2SoapEnvelopeXml(aid, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 644:   
 645:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 646:   
 647:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 648:              {
 649:                  subscriber = Ia.Ngn.Cl.Model.Business.Nokia.Subscriber.ParseFromDictionary(response.ParameterDictionaryList[0]);
 650:              }
 651:              else subscriber = null;
 652:   
 653:              return subscriber;
 654:          }
 655:   
 656:          ////////////////////////////////////////////////////////////////////////////
 657:   
 658:          /// <summary>
 659:          ///
 660:          /// </summary>
 661:          public Ia.Ngn.Cl.Model.Nokia.Subscriber RtrvNgfsSubscriberV2(string aid, string primarySwitch, int imsService, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 662:          {
 663:              XmlDocument soapResultEnvelopeXmlDocument;
 664:              Ia.Ngn.Cl.Model.Nokia.Subscriber subscriber;
 665:   
 666:              SendSoapRequestAndReadResponse(RtrvNgfsSubscriberV2SoapEnvelopeXml(aid, primarySwitch, imsService, sessionId), out soapResultEnvelopeXmlDocument);
 667:   
 668:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 669:   
 670:              if (response.ResultCode == Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful)
 671:              {
 672:                  subscriber = Ia.Ngn.Cl.Model.Business.Nokia.Subscriber.ParseFromDictionary(response.ParameterDictionaryList[0]);
 673:              }
 674:              else subscriber = null;
 675:   
 676:              return subscriber;
 677:          }
 678:   
 679:          ////////////////////////////////////////////////////////////////////////////
 680:   
 681:          /// <summary>
 682:          ///
 683:          /// </summary>
 684:          public void DltNgfsSubscriberAndNgfsSubPartyV2(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 685:          {
 686:              XmlDocument soapResultEnvelopeXmlDocument;
 687:   
 688:              SendSoapRequestAndReadResponse(DltNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 689:   
 690:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 691:          }
 692:   
 693:          ////////////////////////////////////////////////////////////////////////////
 694:   
 695:          /// <summary>
 696:          ///
 697:          /// </summary>
 698:          public void DltNgfsSubscriberAndNgfsSubPartyV2(string service, string primarySwitch, string fsdb, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 699:          {
 700:              XmlDocument soapResultEnvelopeXmlDocument;
 701:   
 702:              SendSoapRequestAndReadResponse(DltNgfsSubscriberV2SoapEnvelopeXml(service, primarySwitch, fsdb, sessionId), out soapResultEnvelopeXmlDocument);
 703:   
 704:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 705:          }
 706:   
 707:          ////////////////////////////////////////////////////////////////////////////
 708:   
 709:          /// <summary>
 710:          ///
 711:          /// </summary>
 712:          public void EdNgfsSubscriberV2_CallingLineId(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool callingLineIdState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 713:          {
 714:              string xml;
 715:              XmlDocument soapResultEnvelopeXmlDocument;
 716:   
 717:              xml = CallingLineIdXml(service, callingLineIdState);
 718:   
 719:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 720:   
 721:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 722:          }
 723:   
 724:          ////////////////////////////////////////////////////////////////////////////
 725:   
 726:          /// <summary>
 727:          ///
 728:          /// </summary>
 729:          public void EdNgfsSubscriberV2_OneDigitSpeedDial(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool oneDigitSpeedDialState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 730:          {
 731:              string xml;
 732:              XmlDocument soapResultEnvelopeXmlDocument;
 733:   
 734:              xml = OneDigitSpeedDial(service, oneDigitSpeedDialState);
 735:   
 736:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 737:   
 738:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 739:          }
 740:   
 741:          ////////////////////////////////////////////////////////////////////////////
 742:   
 743:          /// <summary>
 744:          ///
 745:          /// </summary>
 746:          public void EdNgfsSubscriberV2_CallForwardingVari(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool callForwardingState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 747:          {
 748:              string xml;
 749:              XmlDocument soapResultEnvelopeXmlDocument;
 750:   
 751:              xml = CallForwardingVariXml(service, callForwardingState);
 752:   
 753:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 754:   
 755:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 756:          }
 757:   
 758:          ////////////////////////////////////////////////////////////////////////////
 759:   
 760:          /// <summary>
 761:          ///
 762:          /// </summary>
 763:          public void EdNgfsSubscriberV2_CallWaiting(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool callWaitingState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 764:          {
 765:              string xml;
 766:              XmlDocument soapResultEnvelopeXmlDocument;
 767:   
 768:              xml = CallWaitingXml(service, callWaitingState);
 769:   
 770:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 771:   
 772:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 773:          }
 774:   
 775:          ////////////////////////////////////////////////////////////////////////////
 776:   
 777:          /// <summary>
 778:          ///
 779:          /// </summary>
 780:          public void EdNgfsSubscriberV2_ConferenceCall(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool conferenceCallState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 781:          {
 782:              string xml;
 783:              XmlDocument soapResultEnvelopeXmlDocument;
 784:   
 785:              xml = ConferenceCallingXml(service, conferenceCallState);
 786:   
 787:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 788:   
 789:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 790:          }
 791:   
 792:          ////////////////////////////////////////////////////////////////////////////
 793:   
 794:          /// <summary>
 795:          ///
 796:          /// </summary>
 797:          public void EdNgfsSubscriberV2_ReminderCall(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool reminderCallState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 798:          {
 799:              string xml;
 800:              XmlDocument soapResultEnvelopeXmlDocument;
 801:   
 802:              xml = ReminderCallXml(service, reminderCallState);
 803:   
 804:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 805:   
 806:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 807:          }
 808:   
 809:          ////////////////////////////////////////////////////////////////////////////
 810:   
 811:          /// <summary>
 812:          ///
 813:          /// </summary>
 814:          public void EdNgfsSubscriberV2_InternationalCalling(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool internationalCallingState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 815:          {
 816:              string xml;
 817:              XmlDocument soapResultEnvelopeXmlDocument;
 818:   
 819:              xml = InternationalCallingXml(service, internationalCallingState);
 820:   
 821:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 822:   
 823:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 824:          }
 825:   
 826:          ////////////////////////////////////////////////////////////////////////////
 827:   
 828:          /// <summary>
 829:          ///
 830:          /// </summary>
 831:          public void EdNgfsSubscriberV2_InternationalCallingUserControlled(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool internationalCallBarringState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 832:          {
 833:              string xml;
 834:              XmlDocument soapResultEnvelopeXmlDocument;
 835:   
 836:              xml = InternationalCallingUserControlledXml(service, internationalCallBarringState);
 837:   
 838:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 839:   
 840:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 841:          }
 842:   
 843:          ////////////////////////////////////////////////////////////////////////////
 844:   
 845:          /// <summary>
 846:          ///
 847:          /// </summary>
 848:          public void EdNgfsSubscriberV2_ServiceSuspension(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool serviceSuspensionState, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 849:          {
 850:              string xml;
 851:              XmlDocument soapResultEnvelopeXmlDocument;
 852:   
 853:              xml = ServiceSuspension(serviceSuspensionState);
 854:   
 855:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2WithinSubPartySoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
 856:   
 857:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 858:          }
 859:   
 860:          ////////////////////////////////////////////////////////////////////////////
 861:   
 862:          /// <summary>
 863:          ///
 864:          /// </summary>
 865:          public void EdNgfsSubscriberAndNgfsSubPartyV2_H248ToSip(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
 866:          {
 867:              XmlDocument soapResultEnvelopeXmlDocument;
 868:   
 869:              SendSoapRequestAndReadResponse(EdNgfsSubscriberV2_H248ToSipSoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
 870:   
 871:              ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
 872:          }
 873:   
 874:          ////////////////////////////////////////////////////////////////////////////
 875:          ////////////////////////////////////////////////////////////////////////////
 876:   
 877:   
 878:   
 879:   
 880:   
 881:   
 882:   
 883:   
 884:          ////////////////////////////////////////////////////////////////////////////
 885:          ////////////////////////////////////////////////////////////////////////////
 886:   
 887:          /// <summary>
 888:          ///
 889:          /// </summary>
 890:          private static XmlDocument ActUserSoapEnvelopeXml(string sessionId)
 891:          {
 892:              XmlDocument soapEnvelopeXml;
 893:              Dictionary<string, string> param;
 894:   
 895:              param = new Dictionary<string, string>();
 896:   
 897:              param.Add("UserName", Ia.Ngn.Cl.Model.Business.Nokia.Ims.UserName);
 898:              param.Add("PassWord", Ia.Ngn.Cl.Model.Business.Nokia.Ims.Password);
 899:   
 900:              soapEnvelopeXml = SoapEnvelopeXml("act-user", param, sessionId, "", "TECICS01", "fsdb0");
 901:   
 902:              return soapEnvelopeXml;
 903:          }
 904:   
 905:          ////////////////////////////////////////////////////////////////////////////
 906:   
 907:          /// <summary>
 908:          ///
 909:          /// <remarks>
 910:          ///   <PlexViewRequest Command="canc-user" SwitchName="" RequestId="" SessionId="test:2012917080">
 911:          ///   </PlexViewRequest>
 912:          /// </remarks>
 913:          /// </summary>
 914:          private static XmlDocument CancUserSoapEnvelopeXml(string sessionId)
 915:          {
 916:              XmlDocument soapEnvelopeXml;
 917:   
 918:              soapEnvelopeXml = SoapEnvelopeXml("canc-user", "", sessionId, "", "TECICS01", "fsdb0");
 919:   
 920:              return soapEnvelopeXml;
 921:          }
 922:   
 923:          /*
 924:          ////////////////////////////////////////////////////////////////////////////
 925:          ////////////////////////////////////////////////////////////////////////////
 926:  
 927:          /// <summary>
 928:          ///
 929:          /// <remarks>
 930:          /// </remarks>
 931:          /// </summary>
 932:          private static XmlDocument EntNgcfAgcfGatewayRecordV2SoapEnvelopeXml(int tableId, int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 933:          {
 934:              int serviceProfileNumber;
 935:              string xmlContent, puid, ip1, ip2, pridUser, privateId, prsetName, prsetNumber, prsetNum, gwUserId, gwName, agcfSipIaPort;
 936:              XmlDocument soapEnvelopeXml;
 937:  
 938:              puid = "sip:rgw" + gwId;
 939:              pridUser = "rgw" + gwId;
 940:              privateId = "rgw" + gwId;
 941:              prsetName = "rgw" + gwId;
 942:              prsetNumber = gwId.ToString();
 943:              prsetNum = gwId.ToString();
 944:              gwUserId = "rgw" + gwId;
 945:              gwName = "rgw" + gwId;
 946:              ip1 = nddOnt.Ip; // "1.4.150.2";
 947:              ip2 = "0.0.0.0";
 948:  
 949:              serviceProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumberAgcfGatewayRecord(nddOnt.Pon.PonGroup.Olt.ImsService);
 950:              agcfSipIaPort = Ia.Ngn.Cl.Model.Business.Nokia.Ims.AgcfSipIaPort(nddOnt.Pon.PonGroup.Olt.ImsService);
 951:  
 952:              xmlContent = @"
 953:      <AgcfGatewayRecord>
 954:      <TableId>" + tableId + @"</TableId>
 955:      <GwId>" + gwId + @"</GwId>
 956:      <GwUserId>" + gwUserId + @"</GwUserId>
 957:      <GwName>" + gwName + @"</GwName>
 958:      <IP1>" + ip1 + @"</IP1>
 959:      <IP2>" + ip2 + @"</IP2>
 960:      <AgcfSipIaPort>" + agcfSipIaPort + @"</AgcfSipIaPort>
 961:      <ConnectionType>UDP/IP</ConnectionType>
 962:      <ContextAudits>Audit Value Based</ContextAudits>
 963:      <GwDigitMapId>1</GwDigitMapId>
 964:      <EnableChannelStatusAudits>false</EnableChannelStatusAudits>
 965:      <GwDomain>ims.moc1.kw</GwDomain>
 966:      <GwPrivId></GwPrivId>
 967:      <LocalTermTypePrefix>td</LocalTermTypePrefix>
 968:      <LocalTermTypeAnalogPrefix>td</LocalTermTypeAnalogPrefix>
 969:      <IsLocalTermTypeTDMAnalog>true</IsLocalTermTypeTDMAnalog>
 970:      <NetTermTypePrefix>RTP/</NetTermTypePrefix>
 971:      <IsNetTermTypeRTPUDP>true</IsNetTermTypeRTPUDP>
 972:      <PhysicalTermIdScheme>Flat Term ID</PhysicalTermIdScheme>
 973:      <SendCompactMessages>true</SendCompactMessages>
 974:      <SendEphemeralPrefix>false</SendEphemeralPrefix>
 975:      <UdpPort>2944</UdpPort>
 976:      <GwVariantId>1</GwVariantId>
 977:      <AreaId>0</AreaId>
 978:      <ComfortNoise>false</ComfortNoise>
 979:      <Dtmf>false</Dtmf>
 980:      <FaxEvents>false</FaxEvents>
 981:      <ModemEvents>false</ModemEvents>
 982:      <TextTelephonyEvents>false</TextTelephonyEvents>
 983:      <AllCodecDataStr>Audio|G.711 - uLaw|20|false</AllCodecDataStr>
 984:      <AgwIuaIpAddress></AgwIuaIpAddress>
 985:      <AgwIuaSctpPort></AgwIuaSctpPort>
 986:      <AgcfLocalSctpPort></AgcfLocalSctpPort>
 987:      <SctpProfile></SctpProfile>
 988:      <IuaIIDMapScheme></IuaIIDMapScheme>
 989:      <LocalTermTypeIsdnPrefix></LocalTermTypeIsdnPrefix>
 990:      <AuditAllActiveIsdnCalls>false</AuditAllActiveIsdnCalls>
 991:      <MateSite>2</MateSite>
 992:      <MateExternalIPAddr>10.16.5.31</MateExternalIPAddr>
 993:      <IsPrimary>true</IsPrimary>
 994:      <AddtionalDigitMapList></AddtionalDigitMapList>
 995:      <AuthTimer>10</AuthTimer>
 996:      <SharedBasNumber>101</SharedBasNumber>
 997:      <SharedPriNumber>523</SharedPriNumber>
 998:      <MgID></MgID>
 999:      <EnnableMD5DigAuteh>false</EnnableMD5DigAuteh>
    <ChannelAudits>Arming Modify and AuditValue done one after another sequentially</ChannelAudits>
    <GroupId>1</GroupId>
    <AgcfGateWayType>RGW/iAD</AgcfGateWayType>
    </AgcfGatewayRecord>
    <HSSPrivateId>
        <PridUser>" + pridUser + @"</PridUser>
        <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
        <PuidUserList>
            <HSSPublicId>
                <Puid>" + puid + @"</Puid>
                <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
            </HSSPublicId>
        </PuidUserList>
    </HSSPrivateId>
";
            soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", nddOnt.Pon.PonGroup.Olt.PrimarySwitch, nddOnt.Pon.PonGroup.Olt.ImsFsdb);
            return soapEnvelopeXml;
        }
        */
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EntNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(int tableId, int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            int serviceProfileNumber;
            string xmlContent, puid, ip1, ip2, mgcIp, mgcSecondaryIp, pridUser, privateId, prsetName, prsetNumber, prsetNum, gwUserId, gwName, agcfSipIaPort;
            XmlDocument soapEnvelopeXml;
 
            puid = "sip:rgw" + gwId;
            pridUser = "rgw" + gwId;
            privateId = "rgw" + gwId;
            prsetName = "rgw" + gwId;
            prsetNumber = gwId.ToString();
            prsetNum = gwId.ToString();
            gwUserId = "rgw" + gwId;
            gwName = "rgw" + gwId;
            ip1 = nddOnt.Ip; // "1.4.150.2";
            ip2 = "0.0.0.0";
            mgcIp = nddOnt.MgcIp;
            mgcSecondaryIp = nddOnt.MgcSecondaryIp;
 
            agcfSipIaPort = Ia.Ngn.Cl.Model.Business.Nokia.Ims.AgcfSipIaPort(nddOnt.ImsService);
            serviceProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumberAgcfGatewayRecord(nddOnt.ImsService);
 
            xmlContent = @"
    <AgcfGatewayRecord>
        <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
        <TableId>" + tableId + @"</TableId>
        <GwId>" + gwId + @"</GwId>
        <AgcfSipIaPort>" + agcfSipIaPort + @"</AgcfSipIaPort>
        <GwUserId>" + gwUserId + @"</GwUserId>
        <GwName>" + gwName + @"</GwName>
        <IP1>" + ip1 + @"</IP1>
        <IP2>" + ip2 + @"</IP2>
        <MateExternalIPAddr>" + mgcSecondaryIp + @"</MateExternalIPAddr>
        <ConnectionType>UDP/IP</ConnectionType>
        <ContextAudits>Audit Value Based</ContextAudits>
        <GwDigitMapId>1</GwDigitMapId>
        <EnableChannelStatusAudits>false</EnableChannelStatusAudits>
        <GwDomain>ims.moc1.kw</GwDomain>
        <GwPrivId></GwPrivId>
        <LocalTermTypePrefix>td</LocalTermTypePrefix>
        <LocalTermTypeAnalogPrefix>td</LocalTermTypeAnalogPrefix>
        <IsLocalTermTypeTDMAnalog>true</IsLocalTermTypeTDMAnalog>
        <NetTermTypePrefix>RTP</NetTermTypePrefix>
        <IsNetTermTypeRTPUDP>true</IsNetTermTypeRTPUDP>
        <PhysicalTermIdScheme>Flat Term ID</PhysicalTermIdScheme>
        <SendCompactMessages>true</SendCompactMessages>
        <SendEphemeralPrefix>false</SendEphemeralPrefix>
        <UdpPort>2944</UdpPort>
        <GwVariantId>1</GwVariantId>
        <AreaId>0</AreaId>
        <ComfortNoise>false</ComfortNoise>
        <Dtmf>false</Dtmf>
        <FaxEvents>false</FaxEvents>
        <ModemEvents>false</ModemEvents>
        <TextTelephonyEvents>false</TextTelephonyEvents>
        <AllCodecDataStr>Audio|G.711 - uLaw|20|false</AllCodecDataStr>
        <AgwIuaIpAddress></AgwIuaIpAddress>
        <AgwIuaSctpPort></AgwIuaSctpPort>
        <AgcfLocalSctpPort></AgcfLocalSctpPort>
        <SctpProfile></SctpProfile>
        <IuaIIDMapScheme></IuaIIDMapScheme>
        <LocalTermTypeIsdnPrefix></LocalTermTypeIsdnPrefix>
        <AuditAllActiveIsdnCalls>false</AuditAllActiveIsdnCalls>
        <MateSite>2</MateSite>
        <IsPrimary>true</IsPrimary>
        <AddtionalDigitMapList></AddtionalDigitMapList>
        <AuthTimer>10</AuthTimer>
        <SharedBasNumber>101</SharedBasNumber>
        <SharedPriNumber>523</SharedPriNumber>
        <MgID></MgID>
        <EnnableMD5DigAuteh>false</EnnableMD5DigAuteh>
        <ChannelAudits>Arming Modify and AuditValue done one after another sequentially</ChannelAudits>
        <GroupId>1</GroupId>
        <AgcfGateWayType>RGW/iAD</AgcfGateWayType>
    </AgcfGatewayRecord>
 
    <HSSPrivateId>
        <PridUser>" + pridUser + @"</PridUser>
        <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
        <PrivPassword>1234</PrivPassword>
        <PridDomainId>0</PridDomainId>
        <PridDomainName>ims.moc1.kw</PridDomainName>
        <ServerCapNumber>0</ServerCapNumber>
        <ProtectionGroupNumber>1</ProtectionGroupNumber>
        <ChargeInfoNum>0</ChargeInfoNum>
        <MediaProfileId>0</MediaProfileId>
        <PuidUserList>
            <HSSPublicId>
                <Puid>" + puid + @"</Puid>
                <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
                <PrivateId>" + privateId + @"</PrivateId>
                <PuidDomainName>ims.moc1.kw</PuidDomainName>
                <PridDomainName>ims.moc1.kw</PridDomainName>
                <IsWildcardPuid>false</IsWildcardPuid>
                <Barring>true</Barring>
                <ImplRegSet>1</ImplRegSet>
                <Authorized>true</Authorized>
                <SendTelURI>false</SendTelURI>
            </HSSPublicId>
        </PuidUserList>
    </HSSPrivateId>
 
    <HSSPrset>
        <PrsetNum>" + prsetNum + @"</PrsetNum>
        <PridUser>" + pridUser + @"</PridUser>
        <PrsetName>" + prsetName + @"</PrsetName>
        <PridDomain>ims.moc1.kw</PridDomain>
        <ServerCapNum>0</ServerCapNum>
    </HSSPrset>
 
    <GeoRedundancyData>
        <AgcfGatewayRecord>
            <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
            <TableId>" + tableId + @"</TableId>
            <GwId>" + gwId + @"</GwId>
            <AgcfSipIaPort>" + agcfSipIaPort + @"</AgcfSipIaPort>
            <GwUserId>" + gwUserId + @"</GwUserId>
            <GwName>" + gwName + @"</GwName>
            <IP1>" + ip1 + @"</IP1>
            <IP2>" + ip2 + @"</IP2>
             <MateExternalIPAddr>" + mgcIp + @"</MateExternalIPAddr>
            <ConnectionType>UDP/IP</ConnectionType>
            <ContextAudits>Audit Value Based</ContextAudits>
            <GwDigitMapId>1</GwDigitMapId>
            <EnableChannelStatusAudits>false</EnableChannelStatusAudits>
            <GwDomain>ims.moc1.kw</GwDomain>
            <GwPrivId></GwPrivId>
            <LocalTermTypePrefix>td</LocalTermTypePrefix>
            <LocalTermTypeAnalogPrefix>td</LocalTermTypeAnalogPrefix>
            <IsLocalTermTypeTDMAnalog>true</IsLocalTermTypeTDMAnalog>
            <NetTermTypePrefix>RTP</NetTermTypePrefix>
            <IsNetTermTypeRTPUDP>true</IsNetTermTypeRTPUDP>
            <PhysicalTermIdScheme>Flat Term ID</PhysicalTermIdScheme>
            <SendCompactMessages>true</SendCompactMessages>
            <SendEphemeralPrefix>false</SendEphemeralPrefix>
            <UdpPort>2944</UdpPort>
            <GwVariantId>1</GwVariantId>
            <AreaId>0</AreaId>
            <ComfortNoise>false</ComfortNoise>
            <Dtmf>false</Dtmf>
            <FaxEvents>false</FaxEvents>
            <ModemEvents>false</ModemEvents>
            <TextTelephonyEvents>false</TextTelephonyEvents>
            <AllCodecDataStr>Audio|G.711 - uLaw|20|false</AllCodecDataStr>
            <AgwIuaIpAddress></AgwIuaIpAddress>
            <AgwIuaSctpPort></AgwIuaSctpPort>
            <AgcfLocalSctpPort></AgcfLocalSctpPort>
            <SctpProfile></SctpProfile>
            <IuaIIDMapScheme></IuaIIDMapScheme>
            <LocalTermTypeIsdnPrefix></LocalTermTypeIsdnPrefix>
            <AuditAllActiveIsdnCalls>false</AuditAllActiveIsdnCalls>
            <MateSite>2</MateSite>
            <IsPrimary>false</IsPrimary>
            <AddtionalDigitMapList></AddtionalDigitMapList>
            <AuthTimer>10</AuthTimer>
            <SharedBasNumber>101</SharedBasNumber>
            <SharedPriNumber>523</SharedPriNumber>
            <MgID></MgID>
            <EnnableMD5DigAuteh>false</EnnableMD5DigAuteh>
            <ChannelAudits>Arming Modify and AuditValue done one after another sequentially</ChannelAudits>
            <GroupId>1</GroupId>
            <AgcfGateWayType>RGW/iAD</AgcfGateWayType>
        </AgcfGatewayRecord>
        <HSSPrivateId>
            <PridUser>" + pridUser + @"</PridUser>
            <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
            <PrivPassword>1234</PrivPassword>
            <PridDomainId>0</PridDomainId>
            <PridDomainName>ims.moc1.kw</PridDomainName>
            <ServerCapNumber>0</ServerCapNumber>
            <ProtectionGroupNumber>2</ProtectionGroupNumber>
            <ChargeInfoNum>0</ChargeInfoNum>
            <MediaProfileId>0</MediaProfileId>
            <PuidUserList>
                <HSSPublicId>
                    <Puid>" + puid + @"</Puid>
                    <PrivateId>" + privateId + @"</PrivateId>
                    <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
                    <PuidDomainName>ims.moc1.kw</PuidDomainName>
                    <PridDomainName>ims.moc1.kw</PridDomainName>
                    <IsWildcardPuid>false</IsWildcardPuid>
                    <Barring>true</Barring>
                    <ImplRegSet>1</ImplRegSet>
                    <Authorized>true</Authorized>
                    <SendTelURI>false</SendTelURI>
                </HSSPublicId>
            </PuidUserList>
        </HSSPrivateId>
        <HSSPrset>
            <PrsetNum>" + prsetNum + @"</PrsetNum>
            <PridUser>" + pridUser + @"</PridUser>
            <PrsetName>" + prsetName + @"</PrsetName>
            <PridDomain>ims.moc1.kw</PridDomain>
            <ServerCapNum>0</ServerCapNum>
        </HSSPrset>
    </GeoRedundancyData>";
 
            soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-agcfgwcombinedrec-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EdNgfsAgcfGatewayRecordV2_MateExternalIPAddrSoapEnvelopeXml(int tableId, int gwId, string mateExternalIPAddr, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
        <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
        <TableId>" + tableId + @"</TableId>
        <GwId>" + gwId + @"</GwId>
        <MateExternalIPAddr>" + mateExternalIPAddr + @"</MateExternalIPAddr>";
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EdNgfsAgcfGatewayRecordV2_MateSiteSoapEnvelopeXml(int tableId, int gwId, int mateSite, string primarySwitch, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
        <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
        <TableId>" + tableId + @"</TableId>
        <GwId>" + gwId + @"</GwId>
        <MateSite>" + mateSite + @"</MateSite>";
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", primarySwitch); //, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EdNgfsAgcfGatewayRecordV2_IP1SoapEnvelopeXml(int tableId, int gwId, string ip1, string primarySwitch, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
        <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
        <TableId>" + tableId + @"</TableId>
        <GwId>" + gwId + @"</GwId>
        <IP1>" + ip1 + @"</IP1>";
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", primarySwitch); //, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(int tableId, int gwId, string primarySwitch, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
    <AgcfGatewayRecord>
        <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
        <TableId>" + tableId + @"</TableId>
        <GwId>" + gwId + @"</GwId>
    </AgcfGatewayRecord>";
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfgwcombinedrec-v2", xmlContent, sessionId, "", primarySwitch); //, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="rtrv-ngfs-agcfgatewayrecord-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
        ///     <NgcfAgcfGatewayRecordAid>6`2101</NgcfAgcfGatewayRecordAid>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgcfAgcfGatewayRecordV2SoapEnvelopeXml(int tableId, int gwId, string sessionId)
        {
            XmlDocument soapEnvelopeXml;
            Dictionary<string, string> param;
 
            param = new Dictionary<string, string>();
 
            param.Add("NgcfAgcfGatewayRecordAid", tableId + "`" + gwId);
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfgatewayrecord-v2", param, sessionId, "", Ia.Ngn.Cl.Model.Business.Nokia.Ims.AnyPrimarySwitch);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// Read from SKB side
        /// <remarks>
        ///   <PlexViewRequest Command="rtrv-ngfs-agcfgatewayrecord-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
        ///     <NgcfAgcfGatewayRecordAid>6`2101</NgcfAgcfGatewayRecordAid>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgcfAgcfGatewayRecordFromSkbV2SoapEnvelopeXml(int tableId, int gwId, string sessionId)
        {
            XmlDocument soapEnvelopeXml;
            Dictionary<string, string> param;
 
            param = new Dictionary<string, string>();
 
            param.Add("NgcfAgcfGatewayRecordAid", tableId + "`" + gwId);
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfgatewayrecord-v2", param, sessionId, "", Ia.Ngn.Cl.Model.Business.Nokia.Ims.SKB);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="dlt-ngfs-agcfgatewayrecord-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
        ///     <NgcfAgcfGatewayRecordAid>6`2101</NgcfAgcfGatewayRecordAid>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgcfAgcfGatewayRecordV2SoapEnvelopeXml(int tableId, int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            XmlDocument soapEnvelopeXml;
            Dictionary<string, string> param;
 
            param = new Dictionary<string, string>();
 
            param.Add("NgcfAgcfGatewayRecordAid", tableId + "`" + gwId);
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfgatewayrecord-v2", param, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EntNgfsAgcfEndpointV2SoapEnvelopeXml(string service, int gwId, int flatTermId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string xmlContent, prividUser, dn;
            XmlDocument soapEnvelopeXml;
 
            prividUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PrividUser(service);
            dn = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Dn(service);
 
            xmlContent = @"
    <PrividUser>" + prividUser + @"</PrividUser>
    <GwId>" + gwId + @"</GwId>
    <Dn>" + dn + @"</Dn>
    <FlatTermID>" + flatTermId + @"</FlatTermID>
    <Slot>0</Slot>
    <Port>0</Port>
    <AdditionalDNs></AdditionalDNs>
    <DomainIndex>0</DomainIndex>
    <FeatureFlag>0</FeatureFlag>
    <DslamId></DslamId>
    <Rack>-1</Rack>
    <Shelf>0</Shelf>
    <SubscriberType>Analog</SubscriberType>
    <ReversePolarity>UPON_DIGIT_COLLECTION_ALWAYS</ReversePolarity>
    <PayphoneMetering>PAYPHONE_PULSE_METERING_16_KHZ</PayphoneMetering>
    <DigitMap1st>0</DigitMap1st>
    <DigitMap2nd>0</DigitMap2nd>
    <DialTone2nd>0</DialTone2nd>
    <CallHoldLc>true</CallHoldLc>
    <CallWaitingLc>false</CallWaitingLc>
    <CallToggleLc>true</CallToggleLc>
    <ThreeWayCallLc>true</ThreeWayCallLc>
    <McidLc>false</McidLc>
    <CallTransferLc>false</CallTransferLc>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private static XmlDocument EdNgfsAgcfEndpointV2SoapEnvelopeXml_CallWaiting(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool serviceAssigned, string sessionId)
        {
            string xmlContent, prividUser, value;
            XmlDocument soapEnvelopeXml;
 
            prividUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PrividUser(service);
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xmlContent = @"
    <PrividUser>" + prividUser + @"</PrividUser>
    <CallWaitingLc>" + value + @"</CallWaitingLc>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="rtrv-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1946199540" MaxRows="-1">
        ///   <PrividUser>priv_96522239100</PrividUser>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(string prividUser, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            XmlDocument soapEnvelopeXml;
            Dictionary<string, string> param;
 
            param = new Dictionary<string, string>();
 
            param.Add("PrividUser", prividUser);
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfendpoint-v2", param, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// <PlexViewRequest Command="rtrv-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb2" RequestId="" SessionId="ngnAPI:1313903573" MaxRows="4">
        ///   <filter>
        ///     <search>
        ///       <searchby>GwId</searchby>
        ///       <searchstring>2463</searchstring>
        ///       <operation>Equals</operation>
        ///       <caseSensitive>false</caseSensitive>
        ///     </search>
        ///   </filter>
        /// </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
    <filter>
        <search>
            <searchby>GwId</searchby>
            <searchstring>" + gwId + @"</searchstring>
            <operation>Equals</operation>
            <caseSensitive>false</caseSensitive>
        </search>
    </filter>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// <PlexViewRequest Command="rtrv-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb2" RequestId="" SessionId="ngnAPI:1313903573" MaxRows="4">
        ///   <filter>
        ///     <search>
        ///       <searchby>GwId</searchby>
        ///       <searchstring>2463</searchstring>
        ///       <operation>Equals</operation>
        ///       <caseSensitive>false</caseSensitive>
        ///     </search>
        ///   </filter>
        /// </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(int gwId, string primarySwitch, int imsService, string sessionId)
        {
            string xmlContent, imsFsdb;
            XmlDocument soapEnvelopeXml;
 
            imsFsdb = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ImsFsdb(imsService, primarySwitch);
 
            xmlContent = @"
    <filter>
        <search>
            <searchby>GwId</searchby>
            <searchstring>" + gwId + @"</searchstring>
            <operation>Equals</operation>
            <caseSensitive>false</caseSensitive>
        </search>
    </filter>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", primarySwitch, imsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="dlt-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1946199540" MaxRows="-1">
        ///   <PrividUser>priv_96522239100</PrividUser>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgfsAgcfEndpointV2SoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string prividUser;
            XmlDocument soapEnvelopeXml;
            Dictionary<string, string> param;
 
            prividUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PridUser(service);
 
            param = new Dictionary<string, string>();
 
            param.Add("PrividUser", prividUser);
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfendpoint-v2", param, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="dlt-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1946199540" MaxRows="-1">
        ///   <PrividUser>priv_96522239100</PrividUser>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgfsAgcfEndpointV2SoapEnvelopeXml(string service, string primarySwitch, string fsdb, string sessionId)
        {
            string prividUser;
            XmlDocument soapEnvelopeXml;
            Dictionary<string, string> param;
 
            prividUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PridUser(service);
 
            param = new Dictionary<string, string>();
 
            param.Add("PrividUser", prividUser);
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfendpoint-v2", param, sessionId, "", primarySwitch, fsdb);
 
            return soapEnvelopeXml;
        }
 
        /*
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EntNgfsSubPartyV2SoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            // Not used. Subparty is created and deleted with subscriber
            int applicationServerId, serviceProfileNumber;
            string xmlContent, partyId, primaryPuid, alternateFsdbFqdn, assocOtasRealm, alternateOtasRealm;
            XmlDocument soapEnvelopeXml;
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
            primaryPuid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PrimaryPuid(service);
            Ia.Ngn.Cl.Model.Business.Nokia.Ims.AssocAndAlternateOtasRealm(nddOnt.PrimarySwitch, nddOnt.ImsFsdb, out applicationServerId, out assocOtasRealm, out alternateOtasRealm);
            serviceProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumber(applicationServerId);
            alternateFsdbFqdn = Ia.Ngn.Cl.Model.Business.Nokia.Ims.AlternateFsdbFqdn(nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
            xmlContent = @"
    <PartyId>" + partyId + @"</PartyId>
    <PrimaryPUID>" + primaryPuid + @"</PrimaryPUID>
    <DisplayName>" + service + @"</DisplayName>
    <AssocOtasRealm>" + assocOtasRealm + @"</AssocOtasRealm>
    <AlternateFsdbFqdn>" + alternateFsdbFqdn + @"</AlternateFsdbFqdn>
    <Category>RESIDENTIALSUBSCRIBER_R2</Category>
    <PrimaryPUIDDomainRequired>false</PrimaryPUIDDomainRequired>
    <PrimaryPUIDCPEProfileNumber>0</PrimaryPUIDCPEProfileNumber>
    <PrimaryPUIDFlashable>false</PrimaryPUIDFlashable>
    <NetworkProfileName></NetworkProfileName>
    <NetworkProfileVersion>0</NetworkProfileVersion>
    <ServiceProfileName></ServiceProfileName>
    <ServiceProfileVersion>0</ServiceProfileVersion>
    <IsReducedServiceProfile>false</IsReducedServiceProfile>
    <CallLimit>2</CallLimit>
    <ServiceSuspension>false</ServiceSuspension>
    <OriginationSuspension>false</OriginationSuspension>
    <TerminationSuspension>false</TerminationSuspension>
    <SuspensionNotification>false</SuspensionNotification>
    <UserOrigSuspension>false</UserOrigSuspension>
    <UserTermSuspension>false</UserTermSuspension>
    <AssocWpifRealm></AssocWpifRealm>
    <IddPrefix></IddPrefix>
    <SharedHssData>false</SharedHssData>
    <Pin></Pin>
    <MsnCapability>false</MsnCapability>
    <VideoProhibit>false</VideoProhibit>
    <MaxFwdHops>10</MaxFwdHops>
    <CsdFlavor>TAS_CSD_NONE</CsdFlavor>
    <CsdDynamic>false</CsdDynamic>
    <SipErrorTableId>0</SipErrorTableId>
    <TreatmentTableId>0</TreatmentTableId>
    <Locale></Locale>
    <CliPrefixList></CliPrefixList>
    <IsGroupCPE>false</IsGroupCPE>
    <Receive181Mode>TAS_181_NONE</Receive181Mode>
    <CcNdcLength>0</CcNdcLength>
    <MaxActiveCalls>0</MaxActiveCalls>
    <CallingPartyCategory>CPC_ORDINARY</CallingPartyCategory>
    <PublicUID1></PublicUID1>
    <PublicUID2></PublicUID2>
    <PublicUID3></PublicUID3>
    <PublicUID4></PublicUID4>
    <PublicUID5></PublicUID5>
    <PublicUID6></PublicUID6>
    <PublicUID7></PublicUID7>
    <PublicUID8></PublicUID8>
    <PublicUID9></PublicUID9>
    <PublicUID1DomainRequired>false</PublicUID1DomainRequired>
    <PublicUID2DomainRequired>false</PublicUID2DomainRequired>
    <PublicUID3DomainRequired>false</PublicUID3DomainRequired>
    <PublicUID4DomainRequired>false</PublicUID4DomainRequired>
    <PublicUID5DomainRequired>false</PublicUID5DomainRequired>
    <PublicUID6DomainRequired>false</PublicUID6DomainRequired>
    <PublicUID7DomainRequired>false</PublicUID7DomainRequired>
    <PublicUID8DomainRequired>false</PublicUID8DomainRequired>
    <PublicUID9DomainRequired>false</PublicUID9DomainRequired>
    <WildCardPUIDStr></WildCardPUIDStr>
    <AllowCustomAnnouncement>false</AllowCustomAnnouncement>
    <PtySpareLong1>0</PtySpareLong1>
    <PtySpareString></PtySpareString>
    <PtySpareString2></PtySpareString2>
    <PtySpareShort1>0</PtySpareShort1>
    <PtySpareShort2>0</PtySpareShort2>
    <PtySpareBool1>false</PtySpareBool1>
    <PtySpareBool2>false</PtySpareBool2>
    <PtySpareBool3>false</PtySpareBool3>
    <PtySpareBool4>false</PtySpareBool4>
    <PtySpareBool5>false</PtySpareBool5>
    <PtySpareBool6>false</PtySpareBool6>
    <PtySpareBool7>false</PtySpareBool7>
    <PtySpareBool8>false</PtySpareBool8>
    <TerminatingTableId>0</TerminatingTableId>
    <AllowNonSipTelUri>false</AllowNonSipTelUri>
    <LocationType>None</LocationType>
    <RncID></RncID>
    <LteMcc></LteMcc>
    <LteMnc></LteMnc>
    <LteTac></LteTac>
    <MarketSID></MarketSID>
    <SwitchNumber></SwitchNumber>
    <CallsToWebUserProhibited>false</CallsToWebUserProhibited>
    <IMSI></IMSI>
    <IMSNotSupported>false</IMSNotSupported>
    <ValidateCellID>false</ValidateCellID>
    <OperatorID>0</OperatorID>
    <HomeMTA>0</HomeMTA>
    <ForwardDenyNumbers>false</ForwardDenyNumbers>
    <PlayAnnoFailNotForward>false</PlayAnnoFailNotForward>
    <MrfPoolID>0</MrfPoolID>
    <Custom120x>false</Custom120x>
";
            soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-subparty-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
            return soapEnvelopeXml;
        }
        */
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1642424089" MaxRows="-1">
        ///       <SubParty>
        ///               <PartyId>+96522239100</PartyId>
        ///     </SubParty>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsSubPartyV2SoapEnvelopeXml(string partyId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
    <Aid>" + partyId + @"</Aid>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subparty-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1642424089" MaxRows="-1">
        ///       <SubParty>
        ///               <PartyId>+96522239100</PartyId>
        ///     </SubParty>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsSubPartyV2SoapEnvelopeXml(string partyId, string primarySwitch, int imsService, string sessionId)
        {
            string xmlContent, imsFsdb;
            XmlDocument soapEnvelopeXml;
 
            imsFsdb = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ImsFsdb(imsService, primarySwitch);
 
            xmlContent = @"
    <Aid>" + partyId + @"</Aid>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subparty-v2", xmlContent, sessionId, "", primarySwitch, imsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="dlt-ngfs-subparty-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
        ///     <PartyId>+96522239100</PartyId>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgfsSubPartyV2SoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            // Not used. Subparty is created and deleted with subscriber
 
            string xmlContent, partyId;
            XmlDocument soapEnvelopeXml;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 
            xmlContent = @"
    <Aid>" + partyId + @"</Aid>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-subparty-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private static XmlDocument EntNgfsSubscriberV2SoapEnvelopeXml(string service, bool isSip, int gwId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            bool sendTelURI;
            int applicationServerId, prsetNumber, serviceProfileNumber, primaryPUIDCPEProfileNumber;
            string xmlContent, partyId, primaryPuid, domainName, alternateFsdbFqdn, assocOtasRealm, alternateOtasRealm;
            XmlDocument soapEnvelopeXml;
 
            domainName = "ims.moc1.kw";
            sendTelURI = true;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
            primaryPuid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PrimaryPuid(service);
 
            if (isSip)
            {
                prsetNumber = 0;
                primaryPUIDCPEProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.PrimaryPUIDCPEProfileNumberForSip;
            }
            else // if H.248
            {
                prsetNumber = gwId;
                primaryPUIDCPEProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.PrimaryPUIDCPEProfileNumberForH248;
            }
 
            Ia.Ngn.Cl.Model.Business.Nokia.Ims.AssocAndAlternateOtasRealm(nddOnt.PrimarySwitch, nddOnt.ImsFsdb, out applicationServerId, out assocOtasRealm, out alternateOtasRealm);
 
            serviceProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumber(applicationServerId);
 
            alternateFsdbFqdn = Ia.Ngn.Cl.Model.Business.Nokia.Ims.AlternateFsdbFqdn(nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            /*
<SubParty>
    <PartyId>" + partyId + @"</PartyId>
    <PrimaryPUID>" + primaryPuid + @"</PrimaryPUID>
    <AssocOtasRealm>" + assocOtasRealm + @"</AssocOtasRealm>
    <Category>RESIDENTIALSUBSCRIBER_R2</Category>
</SubParty>
            */
 
            xmlContent = @"    
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
        <PrimaryPUID>" + primaryPuid + @"</PrimaryPUID>
        <DisplayName>" + service + @"</DisplayName>
        <AssocOtasRealm>" + assocOtasRealm + @"</AssocOtasRealm>
        <AlternateFsdbFqdn>" + alternateFsdbFqdn + @"</AlternateFsdbFqdn>
        <PrimaryPUIDCPEProfileNumber>" + primaryPUIDCPEProfileNumber + @"</PrimaryPUIDCPEProfileNumber>
        <Category>RESIDENTIALSUBSCRIBER_R2</Category>
        <CallLimit>3</CallLimit>
        <MaxFwdHops>5</MaxFwdHops>
        <MaxActiveCalls>3</MaxActiveCalls>
        <CliPrefixList>965</CliPrefixList>
    </SubParty>
    <AlternateOtasRealm>" + alternateOtasRealm + @"</AlternateOtasRealm>"
                                              + InternationalCallingXml(service, false)
                                              + DialingPlanXml(service)
                                              + HSSPrivateIdXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelURI)
                                              + GeoRedundancyDataXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelURI)
                                              ;
 
            soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EdNgfsSubscriberV2SoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId, string xml)
        {
            string partyId, xmlContent;
            XmlDocument soapEnvelopeXml;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 
            xmlContent = @"
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
    </SubParty>
"
                                              + xml
                                              ;
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EdNgfsSubscriberV2_H248ToSipSoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            bool sendTelUri;
            int applicationServerId, prsetNumber, serviceProfileNumber, primaryPUIDCPEProfileNumber;
            string xmlContent, partyId, domainName, assocOtasRealm, alternateOtasRealm;
            XmlDocument soapEnvelopeXml;
 
            domainName = "ims.moc1.kw";
            sendTelUri = true;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 
            prsetNumber = 0;
            primaryPUIDCPEProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.PrimaryPUIDCPEProfileNumberForSip;
 
            Ia.Ngn.Cl.Model.Business.Nokia.Ims.AssocAndAlternateOtasRealm(nddOnt.PrimarySwitch, nddOnt.ImsFsdb, out applicationServerId, out assocOtasRealm, out alternateOtasRealm);
 
            serviceProfileNumber = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumber(applicationServerId);
 
            xmlContent = @"    
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
        <PrimaryPUIDCPEProfileNumber>" + primaryPUIDCPEProfileNumber + @"</PrimaryPUIDCPEProfileNumber>
    </SubParty>"
 
                                              + HSSPrivateIdXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelUri)
                                              + GeoRedundancyDataXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelUri)
                                              ;
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// </remarks>
        /// </summary>
        private static XmlDocument EdNgfsSubscriberV2WithinSubPartySoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId, string xml)
        {
            string partyId, xmlContent;
            XmlDocument soapEnvelopeXml;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 
            xmlContent = @"
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>"
                   + xml + @"
    </SubParty>";
 
            soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:148964391" MaxRows="-1">
        ///  <aid>+96522239501</aid>
        /// </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsSubscriberV2SoapEnvelopeXml(string partyId, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string xmlContent;
            XmlDocument soapEnvelopeXml;
 
            xmlContent = @"
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
    </SubParty>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        /// <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:148964391" MaxRows="-1">
        ///  <aid>+96522239501</aid>
        /// </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument RtrvNgfsSubscriberV2SoapEnvelopeXml(string partyId, string primarySwitch, int imsService, string sessionId)
        {
            string xmlContent, imsFsdb;
            XmlDocument soapEnvelopeXml;
 
            imsFsdb = Ia.Ngn.Cl.Model.Business.Nokia.Ims.ImsFsdb(imsService, primarySwitch);
 
            xmlContent = @"
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
    </SubParty>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subscriber-v2", xmlContent, sessionId, "", primarySwitch, imsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="dlt-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
        ///   <SubParty>
        ///     <PartyId>+96522239100</PartyId>
        ///    </SubParty>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgfsSubscriberV2SoapEnvelopeXml(string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
        {
            string partyId, xmlContent;
            XmlDocument soapEnvelopeXml;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 
            xmlContent = @"
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
    </SubParty>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// <remarks>
        ///   <PlexViewRequest Command="dlt-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
        ///   <SubParty>
        ///     <PartyId>+96522239100</PartyId>
        ///    </SubParty>
        ///   </PlexViewRequest>
        /// </remarks>
        /// </summary>
        private static XmlDocument DltNgfsSubscriberV2SoapEnvelopeXml(string service, string primarySwitch, string fsdb, string sessionId)
        {
            string partyId, xmlContent;
            XmlDocument soapEnvelopeXml;
 
            partyId = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 
            xmlContent = @"
    <SubParty>
        <PartyId>" + partyId + @"</PartyId>
    </SubParty>
";
 
            soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-subscriber-v2", xmlContent, sessionId, "", primarySwitch, fsdb);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// DialingPlan XML
        /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
        /// </summary>
        private static string DialingPlanXml(string service)
        {
            string publicUid, xml;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            xml = @"
    <DialingPlan>
    <PublicUID>" + publicUid + @"</PublicUID>
    <Assigned>true</Assigned>
    <PerPuid>false</PerPuid>
    <PrefixandFeatureCode>1000</PrefixandFeatureCode>
    <E164NormAndCodeConv>1001</E164NormAndCodeConv>
        <CallBarringLocal>0</CallBarringLocal>
        <ESRN1></ESRN1>
        <ESRN2></ESRN2>
        <ESRN3></ESRN3>
        <ESRN4></ESRN4>
        <ESRN5></ESRN5>
        <PrivateDialingPlan>0</PrivateDialingPlan>
    </DialingPlan>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// SetTZPath XML
        /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
        /// </summary>
        private static string SetTZPathXml(string publicUid)
        {
            string xml;
 
            xml = @"
    <SetTZPath>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>true</Assigned>
        <PerPuid>false</PerPuid>
        <TZPath>Asia/Kuwait</TZPath>
    </SetTZPath>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// HSSPrivateId XML
        /// <param name="service">22239100</param>
        /// <param name="prsetNumber">2101</param>
        /// <param name="domainName">ims.moc1.kw</param>
        /// </summary>
        private static string HSSPrivateIdXml(string service, int prsetNumber, string domainName, int serviceProfileNumber, bool sendTelURI)
        {
            string xml, pridUser, puid, sendTelURIString;
 
            pridUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PridUser(service);
            puid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Puid(service);
 
            sendTelURIString = Convert.ToString(sendTelURI).ToLower();
 
            // <PridDomainId>0</PridDomainId>
 
            xml = @"
    <HSSPrivateId>
        <PridDomainName>" + domainName + @"</PridDomainName>
        <PridUser>" + pridUser + @"</PridUser>
        <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
        <PrivPassword>1234</PrivPassword>
        <ServerCapNumber>0</ServerCapNumber>
        <ProtectionGroupNumber>0</ProtectionGroupNumber>
        <ChargeInfoNum>0</ChargeInfoNum>
        <MediaProfileId>0</MediaProfileId>
        <PuidUserList>
            <HSSPublicId>
                <PuidDomainName>" + domainName + @"</PuidDomainName>
                <PridDomainName>" + domainName + @"</PridDomainName>
                <PrivateId>" + pridUser + @"</PrivateId>
                <Puid>" + puid + @"</Puid>
                <IsWildcardPuid>false</IsWildcardPuid>
                <Barring>false</Barring>
                <ImplRegSet>1</ImplRegSet>
                <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
                <Authorized>true</Authorized>
                <SendTelURI>" + sendTelURIString + @"</SendTelURI>
            </HSSPublicId>
        </PuidUserList>
    </HSSPrivateId>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// GeoRedundancyData XML
        /// <param name="service">22239100</param>
        /// <param name="prsetNumber">2101</param>
        /// <param name="domainName">ims.moc1.kw</param>
        /// </summary>
        private static string GeoRedundancyDataXml(string service, int prsetNumber, string domainName, int serviceProfileNumber, bool sendTelURI)
        {
            string xml, pridUser, puid, sendTelURIString;
 
            pridUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PridUser(service);
            puid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Puid(service);
 
            sendTelURIString = Convert.ToString(sendTelURI).ToLower();
 
            xml = @"
    <GeoRedundancyData>
        <HSSPrivateId>
            <PridDomainName>" + domainName + @"</PridDomainName>
            <PridUser>" + pridUser + @"</PridUser>
            <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
            <PrivPassword>1234</PrivPassword>
            <ServerCapNumber>0</ServerCapNumber>
            <ProtectionGroupNumber>0</ProtectionGroupNumber>
            <ChargeInfoNum>0</ChargeInfoNum>
            <MediaProfileId>0</MediaProfileId>
            <PuidUserList>
                <HSSPublicId>
                    <PuidDomainName>" + domainName + @"</PuidDomainName>
                    <PridDomainName>" + domainName + @"</PridDomainName>
                    <PrivateId>" + pridUser + @"</PrivateId>
                    <Puid>" + puid + @"</Puid>
                    <IsWildcardPuid>false</IsWildcardPuid>
                    <Barring>false</Barring>
                    <ImplRegSet>1</ImplRegSet>
                    <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
                    <Authorized>true</Authorized>
                    <SendTelURI>" + sendTelURIString + @"</SendTelURI>
                </HSSPublicId>
            </PuidUserList>
        </HSSPrivateId>
    </GeoRedundancyData>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// OneDigitSpeedDial XML
        /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
        /// </summary>
        private static string OneDigitSpeedDialXml(string publicUid)
        {
            string xml;
 
            xml = @"
    <OneDigitSpeedDial>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>true</Assigned>
        <PerPuid>false</PerPuid>
        <DialCodesEntries>2^^^^^^^</DialCodesEntries>
        <DNEntries>22334455^^^^^^^</DNEntries>
    </OneDigitSpeedDial>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// CallingLineId XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string CallingLineIdXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <CallingLineId>
        <PublicUID>" + publicUid + @"</PublicUID>
        <CallingLineIdPresentation>" + value + @"</CallingLineIdPresentation>
        <ConnectedLinePresentation>" + value + @"</ConnectedLinePresentation>
        <Assigned>true</Assigned>
        <PerPuid>false</PerPuid>
        <CallingLineIdRestriction>PERM_PUBLIC</CallingLineIdRestriction>
        <CLIREditAllowed>false</CLIREditAllowed>
        <CallingNamePresentation>false</CallingNamePresentation>
        <RestrictionOverride>false</RestrictionOverride>
        <ConnectedLineRestriction>false</ConnectedLineRestriction>
        <ConnectedLineRestrictionOverride>false</ConnectedLineRestrictionOverride>
        <CallingNumScreen>0</CallingNumScreen>
        <ConnectedNumScreen>0</ConnectedNumScreen>
        <PDPExtensionDisplay>false</PDPExtensionDisplay>
        <COLREditAllowed>false</COLREditAllowed>
        <OrigLineIdRestrictionLevel>NONE</OrigLineIdRestrictionLevel>
        <OIPEditAllowed>false</OIPEditAllowed>
        <BlockPerCallOverride>false</BlockPerCallOverride>
        <SuppressCLIPonCallWaiting>false</SuppressCLIPonCallWaiting>
        <QueCalNameSer>OMITTED</QueCalNameSer>
        <Typ2CanSer>false</Typ2CanSer>
        <CalNameSerUrl>0</CalNameSerUrl>
        <CompanyNameQuery>false</CompanyNameQuery>
        <OrigCallingNameQuery>false</OrigCallingNameQuery>
    </CallingLineId>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// CallForwardingVari XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string CallForwardingVariXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <CallForwardingVari>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>" + value + @"</Assigned>
        <PerPuid>false</PerPuid>
        <ForwardToDN></ForwardToDN>
        <PingRing>false</PingRing>
        <ForwardToType>FORWARD_TO_DN</ForwardToType>
        <EditPermission>EDIT_FULL</EditPermission>
        <ForwardVoiceCalls>true</ForwardVoiceCalls>
        <ForwardDataCalls>true</ForwardDataCalls>
        <ReceiveNotify>false</ReceiveNotify>
        <PlayAnnouncement>false</PlayAnnouncement>
        <PinRequired>false</PinRequired>
        <Send181Mode>TAS_181_NONE</Send181Mode>
        <RestrictIdForward>false</RestrictIdForward>
        <RestrictIdBackward>false</RestrictIdBackward>
        <DataForwardToType>USE_VOICE</DataForwardToType>
        <DataForwardToDN></DataForwardToDN>
        <Activated>false</Activated>
    </CallForwardingVari>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// CallWaiting XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string CallWaitingXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <CallWaiting>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>true</Assigned>
        <PerPuid>false</PerPuid>
        <PlayAnnouncement>false</PlayAnnouncement>
        <IsAlternateCallWaiting>false</IsAlternateCallWaiting>
        <Programmable>false</Programmable>
        <Activated>" + value + @"</Activated>
    </CallWaiting>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// ConferenceCalling XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string ConferenceCallingXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <ConferenceCalling>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>" + value + @"</Assigned>
        <PerPuid>false</PerPuid>
        <Transfer>false</Transfer>
        <ConfSize>3</ConfSize>
    </ConferenceCalling>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// ReminderCall XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string ReminderCallXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <ReminderCall>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>" + value + @"</Assigned>
        <PerPuid>false</PerPuid>
        <RetryCounter>5</RetryCounter>
        <NoAnswerTimer>0</NoAnswerTimer>
    </ReminderCall>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// OneDigitSpeedDial XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string OneDigitSpeedDial(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <OneDigitSpeedDial>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>" + value + @"</Assigned>
        <PerPuid>false</PerPuid>
    </OneDigitSpeedDial>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// InternationalCalling XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string InternationalCallingXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, serviceAssignedString;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            serviceAssignedString = Convert.ToString(!serviceAssigned).ToLower(); // see !
 
            //         <Assigned>" + serviceAssignedString + @"</Assigned>
            // <Assigned>false</Assigned> will set the whole CallBarring tag to null
 
            xml = @"
    <CallBarring>
        <PublicUID>" + publicUid + @"</PublicUID>
        <International>" + serviceAssignedString + @"</International>
        <Assigned>" + serviceAssignedString + @"</Assigned>
        <PerPuid>false</PerPuid>
        <CallBarringAll>false</CallBarringAll>
        <Local>false</Local>
        <IntraLataToll>false</IntraLataToll>
        <InterLataToll>false</InterLataToll>
        <National>false</National>
        <PremiumServ>false</PremiumServ>
        <Emergency>false</Emergency>
        <TollFree>false</TollFree>
        <FGDDialedCarrier>false</FGDDialedCarrier>
        <FGBDialedCarrier>false</FGBDialedCarrier>
        <DirectoryAssist>false</DirectoryAssist>
        <NXXCalls>false</NXXCalls>
        <User1>false</User1>
        <User2>false</User2>
        <User3>false</User3>
        <User4>false</User4>
        <User5>false</User5>
        <User6>false</User6>
        <User7>false</User7>
        <User8>false</User8>
        <User9>false</User9>
        <User10>false</User10>
        <User11>false</User11>
        <User12>false</User12>
        <User13>false</User13>
        <NonE164>false</NonE164>
        <Mobile>false</Mobile>
        <CntrlCallBarringAll>false</CntrlCallBarringAll>
        <CntrlDirectoryAssist>false</CntrlDirectoryAssist>
        <CntrlEmergency>false</CntrlEmergency>
        <CntrlFGBDialedCarrier>false</CntrlFGBDialedCarrier>
        <CntrlFGDDialedCarrier>false</CntrlFGDDialedCarrier>
        <CntrlInterLataToll>false</CntrlInterLataToll>
        <CntrlInternational>false</CntrlInternational>
        <CntrlIntraLataToll>false</CntrlIntraLataToll>
        <CntrlLocal>false</CntrlLocal>
        <CntrlNational>false</CntrlNational>
        <CntrlNXXCalls>false</CntrlNXXCalls>
        <CntrlPremiumServ>false</CntrlPremiumServ>
        <CntrlTollFree>false</CntrlTollFree>
        <CntrlUser1>false</CntrlUser1>
        <CntrlUser2>false</CntrlUser2>
        <CntrlUser3>false</CntrlUser3>
        <CntrlUser4>false</CntrlUser4>
        <CntrlUser5>false</CntrlUser5>
        <CntrlUser6>false</CntrlUser6>
        <CntrlUser7>false</CntrlUser7>
        <CntrlUser8>false</CntrlUser8>
        <CntrlUser9>false</CntrlUser9>
        <CntrlUser10>false</CntrlUser10>
        <CntrlUser11>false</CntrlUser11>
        <CntrlUser12>false</CntrlUser12>
        <CntrlUser13>false</CntrlUser13>
        <ReceiveNotify>false</ReceiveNotify>
        <CntrlUserCallLock>false</CntrlUserCallLock>
        <LockSet>0</LockSet>
        <CntrlNonE164>false</CntrlNonE164>
        <CntrlMobile>false</CntrlMobile>
    </CallBarring>";
 
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// InternationalCallingUserControlled XML
        /// <param name="service">22239100</param>
        /// <param name="serviceAssigned">true</param>
        /// </summary>
        private static string InternationalCallingUserControlledXml(string service, bool serviceAssigned)
        {
            string publicUid, xml, value;
 
            publicUid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PublicUid(service);
 
            value = Convert.ToString(serviceAssigned).ToLower();
 
            xml = @"
    <OutgoingCallBarring>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>" + value + @"</Assigned>
        <AdminActive>false</AdminActive>
        <AdminProgram>0</AdminProgram>
        <UserCtrl>true</UserCtrl>
        <UserActive>true</UserActive>
        <UserProgram>1</UserProgram>
        <ReceiveNotify>false</ReceiveNotify>
        <PerPuid>false</PerPuid>
    </OutgoingCallBarring>";
 
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// ServiceSuspension XML
        /// <param name="serviceSuspensionState"
        /// </summary>
        private static string ServiceSuspension(bool serviceSuspensionState)
        {
            string xml, value;
 
            value = Convert.ToString(serviceSuspensionState).ToLower();
 
            xml = @"
    <ServiceSuspension>" + value + @"</ServiceSuspension>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// PinService XML
        /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
        /// </summary>
        private static string PinServiceXml(string publicUid)
        {
            string xml;
 
            xml = @"
    <PinService>
        <PublicUID>" + publicUid + @"</PublicUID>
        <Assigned>true</Assigned>
        <PerPuid>false</PerPuid>
        <Pin>0000</Pin>
        <PinFrozen>false</PinFrozen>
    </PinService>
";
            return xml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private static XmlDocument SoapEnvelopeXml(string command, string xmlContent, string sessionId, string requestId, string switchName, string fsdb)
        {
            string s;
            XmlDocument soapEnvelopeXml = new XmlDocument();
 
            s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
    <soap-env:Header />
    <soap-env:Body>
        <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" Fsdb=""" + fsdb + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""32"">";
 
            s += xmlContent;
 
            s += @"
        </PlexViewRequest>
    </soap-env:Body>
</soap-env:Envelope>";
 
            soapEnvelopeXml.LoadXml(s);
 
            // below: To avoid XML shorthand closing tag you can set the IsEmpty property to false for all elements not having any child nodes:
            //foreach (XmlElement el in soapEnvelopeXml.SelectNodes("descendant::*[not(node())]")) el.IsEmpty = false;
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private static XmlDocument SoapEnvelopeXml(string command, string xmlContent, string sessionId, string requestId, string switchName)
        {
            string s;
            XmlDocument soapEnvelopeXml = new XmlDocument();
 
            s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
    <soap-env:Header />
    <soap-env:Body>
        <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""32"">";
 
            s += xmlContent;
 
            s += @"
        </PlexViewRequest>
    </soap-env:Body>
</soap-env:Envelope>";
 
            soapEnvelopeXml.LoadXml(s);
 
            // below: To avoid XML shorthand closing tag you can set the IsEmpty property to false for all elements not having any child nodes:
            //foreach (XmlElement el in soapEnvelopeXml.SelectNodes("descendant::*[not(node())]")) el.IsEmpty = false;
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private static XmlDocument SoapEnvelopeXml(string command, Dictionary<string, string> param, string sessionId, string requestId, string switchName)
        {
            string s, name, value;
            XmlDocument soapEnvelopeXml = new XmlDocument();
 
            s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
    <soap-env:Header />
    <soap-env:Body>
        <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""-1"">";
 
            if (param != null)
            {
                foreach (KeyValuePair<string, string> u in param)
                {
                    name = u.Key;
                    value = u.Value;
 
                    s += @"            <" + name + @">" + value + @"</" + name + @">";
                }
            }
 
            s += @"
        </PlexViewRequest>
    </soap-env:Body>
</soap-env:Envelope>";
 
            soapEnvelopeXml.LoadXml(s);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private static XmlDocument SoapEnvelopeXml(string command, Dictionary<string, string> param, string sessionId, string requestId, string switchName, string fsdb)
        {
            string s, name, value;
            XmlDocument soapEnvelopeXml = new XmlDocument();
 
            s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
    <soap-env:Header />
    <soap-env:Body>
        <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" Fsdb=""" + fsdb + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""-1"">";
 
            if (param != null)
            {
                foreach (KeyValuePair<string, string> u in param)
                {
                    name = u.Key;
                    value = u.Value;
 
                    s += @"            <" + name + @">" + value + @"</" + name + @">";
                }
            }
 
            s += @"
        </PlexViewRequest>
    </soap-env:Body>
</soap-env:Envelope>";
 
            soapEnvelopeXml.LoadXml(s);
 
            return soapEnvelopeXml;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private void SendSoapRequestAndReadResponse(XmlDocument soapEnvelopeXml, out XmlDocument soapResultXmlDocument)
        {
            string url, action;
            string soapResult;
            HttpWebRequest request;
 
            sessionId = string.Empty;
            soapResultXmlDocument = new XmlDocument();
 
            url = Ia.Ngn.Cl.Model.Business.Nokia.Ims.BaseAddress + "/" + Ia.Ngn.Cl.Model.Business.Nokia.Ims.ServiceUrl;
            action = "PlexViewRequest";
 
            request = CreateWebRequest(url, action);
 
            byte[] bytes;
            bytes = System.Text.Encoding.ASCII.GetBytes(soapEnvelopeXml.OuterXml);
            request.ContentType = "text/xml; encoding='utf-8'";
            request.ContentLength = bytes.Length;
            request.Method = "POST";
 
            try
            {
                using (Stream stream = request.GetRequestStream())
                {
                    stream.Write(bytes, 0, bytes.Length);
                    //soapEnvelopeXml.Save(stream);
                }
 
                using (WebResponse response = request.GetResponse())
                {
                    using (StreamReader rd = new StreamReader(response.GetResponseStream()))
                    {
                        soapResult = rd.ReadToEnd();
 
                        soapResultXmlDocument.LoadXml(soapResult);
                    }
                }
            }
            catch (Exception)// e)
            {
            }
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        private void ParseSoapResultXml(XmlDocument soapResultXmlDocument, out Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response response)
        {
            Dictionary<string, string> parameterDictionary;
            XmlNode xn;
 
            response = new Ia.Ngn.Cl.Model.Business.Nokia.Ims.Response();
 
            parameterDictionary = new Dictionary<string, string>();
            response.ParameterDictionaryList = new List<Dictionary<string, string>>(32);
 
            if (soapResultXmlDocument.DocumentElement != null)
            {
                xn = soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild;
 
                commandInLower = xn.Attributes["Command"].Value.ToLower();
                switchName = xn.Attributes["SwitchName"].Value;
                //fsdb = (xn.Attributes["Fsdb"] != null) ? xn.Attributes["Fsdb"].Value : null;
                requestId = xn.Attributes["RequestId"].Value;
                sessionId = xn.Attributes["SessionId"].Value;
                success = xn.Attributes["Status"].Value == "SUCCESS" ? true : false;
 
                if (success)
                {
                    if (commandInLower == "rtrv-ngfs-agcfendpoint-v2" || commandInLower == "dlt-ngfs-agcfendpoint-v2" ||
                        commandInLower == "rtrv-ngfs-agcfgatewayrecord-v2" || commandInLower == "dlt-ngfs-agcfgatewayrecord-v2" ||
                        commandInLower == "rtrv-ngfs-subparty-v2" || commandInLower == "dlt-ngfs-subparty-v2"
                        )
                    {
                        if (soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild.FirstChild != null)
                        {
                            foreach (XmlNode xn2 in soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild.ChildNodes)
                            {
                                parameterDictionary = CollectXmlNodeChildNodesValuesIntoDictionary(xn2);
 
                                response.ParameterDictionaryList.Add(parameterDictionary);
                            }
 
                            response.ResultCode = Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful;
                        }
                        else
                        {
                            response.ResultCode = Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.SuccessfulButNoParameters;
                        }
                    }
                    else /*if(commandInLower == "rtrv-ngfs-subscriber-v2" || commandInLower == "dlt-ngfs-subscriber-v2" )*/
                    {
                        if (soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild != null)
                        {
                            parameterDictionary = CollectXmlNodeChildNodesValuesIntoDictionary(soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild);
 
                            response.ParameterDictionaryList.Add(parameterDictionary);
 
                            response.ResultCode = Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.Successful;
                        }
                        else
                        {
                            response.ResultCode = Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.SuccessfulButNoParameters;
                        }
                    }
 
                    // below: if command is act-user we will read the sessionId from the parameters
                    if (commandInLower == "act-user") sessionId = parameterDictionary["SessionId"].ToString();
                    // below: if command is canc-user we will null the sessionId
                    else if (commandInLower == "canc-user" && success) sessionId = string.Empty;
                }
                else
                {
                    response.FailureReason = xn.Attributes["FailureReason"].Value;
                    response.FailureCode = xn.Attributes["FailureCode"].Value;
 
                    response.ResultCode = (Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode)int.Parse(response.FailureCode);
                }
            }
            else
            {
                response.ResultCode = Ia.Ngn.Cl.Model.Client.Nokia.Ims.ResultCode.DocumentElementIsNull;
            }
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private Dictionary<string, string> CollectXmlNodeChildNodesValuesIntoDictionary(XmlNode xn)
        {
            Dictionary<string, string> parameterDictionary;
 
            parameterDictionary = new Dictionary<string, string>();
 
            foreach (XmlElement xe in xn.ChildNodes)
            {
                // below: if the node has children(?) we will treat it as an XDocument and add its name to a top level tag
                if (xe.ChildNodes.Count > 1) parameterDictionary.Add(xe.Name, xe.OuterXml);
                else parameterDictionary.Add(xe.Name, xe.InnerText);
            }
 
            return parameterDictionary;
        }
 
        ////////////////////////////////////////////////////////////////////////////
 
        /// <summary>
        /// Create a soap webrequest to [Url]
        /// </summary>
        /// <see cref="http://www.roelvanlisdonk.nl/?p=1893"/>
        /// <returns></returns>
        private HttpWebRequest CreateWebRequest(string url, string action)
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
 
            webRequest.Headers.Add(@"SOAP:" + action);
            webRequest.ContentType = "text/xml;charset=\"utf-8\"";
            webRequest.Accept = "text/xml";
            webRequest.Method = "POST";
 
            return webRequest;
        }
 
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
    }
 
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
}