)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Ims (Ia.Ftn.Cl.Models.Client.Nokia)

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

Fixed Telecommunications Network's Operations Support System Management Intranet (FTN OSS) client support class for Nokia's Fixed Telecommunications Network (FTN) 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.Ftn.Cl.Models.Client.Nokia
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// Fixed Telecommunications Network's Operations Support System Management Intranet (FTN OSS) client support class for Nokia's Fixed Telecommunications Network (FTN) 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:     /// </remarks> 
   18:     public class Ims
   19:     {
   20:         private static bool success;
   21:         private static string sessionId, commandInLower, requestId, switchName;
   22:  
   23:         ////////////////////////////////////////////////////////////////////////////
   24:  
   25:         /// <summary>
   26:         /// 1360 COM WebAPI User Guide
   27:         /// </summary>
   28:         public enum ResultCode
   29:         {
   30:             /// <summary/>
   31:             Successful = 0, // added by me
   32:  
   33:             /// <summary/>
   34:             SuccessfulButNoParameters = 100000, // added by me
   35:  
   36:             /// <summary/>
   37:             DocumentElementIsNull = 100001, // added by me
   38:  
   39:             /// <summary/>
   40:             Null = 100002, // added by me
   41:  
   42:             /// <summary/>
   43:             MaximumCombinedNumberOfAgcfGatewayRecordsInAnyMgcIpAndMgcSecondaryIpPairIsExceeded = 100003, // added by me
   44:  
   45:             /// <summary/>
   46:             PlxServiceNoConnectionToSwitch = 1,
   47:  
   48:             /// <summary/>
   49:             PlxServiceInvalidObjectId = 2,
   50:  
   51:             /// <summary/>
   52:             PlxServiceConnectFailure = 3,
   53:  
   54:             /// <summary/>
   55:             PlxServiceObjectDoesNotExist = 4,
   56:  
   57:             /// <summary/>
   58:             PlxNeResponseFailure = 5,
   59:  
   60:             /// <summary/>
   61:             PlxInvalidOperation = 6,
   62:  
   63:             /// <summary/>
   64:             PlxInvalidTid = 7,
   65:  
   66:             /// <summary/>
   67:             PlxSwitchConnectFailed = 8,
   68:  
   69:             /// <summary/>
   70:             PlxSwitchNotManaged = 9,
   71:  
   72:             /// <summary/>
   73:             PlxSwitchNoActiveConnection = 10,
   74:  
   75:             /// <summary/>
   76:             PlxInvalidTl1MetaProcessing = 11,
   77:  
   78:             /// <summary/>
   79:             PlxSwitchVersionMismatch = 13,
   80:  
   81:             /// <summary/>
   82:             PlxInvalidRegularExpression = 14,
   83:  
   84:             /// <summary/>
   85:             PlxInvalidRange = 15,
   86:  
   87:             /// <summary/>
   88:             PlxFileIoError = 17,
   89:  
   90:             /// <summary/>
   91:             PlxXmlError = 18,
   92:  
   93:             /// <summary/>
   94:             PlxTransientState = 19,
   95:  
   96:             /// <summary/>
   97:             PlxUnableToPerformOperation = 21,
   98:  
   99:             /// <summary/>
  100:             PlxMaxConfigurationExceeded = 22,
  101:  
  102:             /// <summary/>
  103:             PlxNotSupported = 23,
  104:  
  105:             /// <summary/>
  106:             PlxReqParameterNotSet = 24,
  107:  
  108:             /// <summary/>
  109:             PlxCongestionControlRequestTimeout = 26,
  110:  
  111:             /// <summary/>
  112:             PlxCongestionControlCongestionDetected = 27,
  113:  
  114:             /// <summary/>
  115:             PlxDbRequestFailure = 10001,
  116:  
  117:             /// <summary/>
  118:             PlxDbLoginFailure = 10002,
  119:  
  120:             /// <summary/>
  121:             PlxUserPrivViolation = 10202,
  122:  
  123:             /// <summary/>
  124:             PlxInvalidIp = 20002,
  125:  
  126:             /// <summary/>
  127:             PlxInvalidNetworkIp = 20003,
  128:  
  129:             /// <summary/>
  130:             PlxDuplicateName = 20006,
  131:  
  132:             /// <summary/>
  133:             PlxInvalidPortId = 20008,
  134:  
  135:             /// <summary/>
  136:             PlxUnableToAddDuplicate = 20011,
  137:  
  138:             /// <summary/>
  139:             PlxUnableToDeleteChildrenExist = 20012,
  140:  
  141:             /// <summary/>
  142:             PlxMustDeleteAclFirst = 20013,
  143:  
  144:             /// <summary/>
  145:             PlxFailure = 20014,
  146:  
  147:             /// <summary/>
  148:             PlxSyncFailure = 20015,
  149:  
  150:             /// <summary/>
  151:             PlxOeNotSupported = 20016,
  152:  
  153:             /// <summary/>
  154:             PlxInvalidCharsInName = 20017,
  155:  
  156:             /// <summary/>
  157:             PlxSwitchEmUsernameInvalidChars = 20108,
  158:  
  159:             /// <summary/>
  160:             PlxSwitchEmPasswordInvalidChars = 20110,
  161:  
  162:             /// <summary/>
  163:             PlxSwitchCannotModifyName = 20121,
  164:  
  165:             /// <summary/>
  166:             PlxRouteInvalidNameLen = 20804,
  167:  
  168:             /// <summary/>
  169:             PlxRouteInvalidNameChars = 20805,
  170:  
  171:             /// <summary/>
  172:             PlxRouteInvalidRouteId = 20806,
  173:  
  174:             /// <summary/>
  175:             PlxRouteInvalidRoutePriority = 20807,
  176:  
  177:             /// <summary/>
  178:             PlxNumberInvalidNpa = 21901,
  179:  
  180:             /// <summary/>
  181:             PlxNumberInvalidNxx = 21902,
  182:  
  183:             /// <summary/>
  184:             PlxInvalidSubscriberId = 22200,
  185:  
  186:             /// <summary/>
  187:             PlxInvalidSubscriberPicCode = 22201,
  188:  
  189:             /// <summary/>
  190:             PlxInvalidSubscriberStatus = 22204,
  191:  
  192:             /// <summary/>
  193:             WebApiFailure = 30000,
  194:  
  195:             /// <summary/>
  196:             SessionInvalid = 30001,
  197:  
  198:             /// <summary/>
  199:             SessionTimedOut = 30002,
  200:  
  201:             /// <summary/>
  202:             RequestTimedOut = 30003,
  203:  
  204:             /// <summary/>
  205:             PlxCtsUnknownError = 50000,
  206:  
  207:             /// <summary/>
  208:             PlxCtsErrorDbUnavail = 50001,
  209:  
  210:             /// <summary/>
  211:             PlxCtsErrorDbError = 50002,
  212:  
  213:             /// <summary/>
  214:             PlxCtsErrorDataInvalid = 50003,
  215:  
  216:             /// <summary/>
  217:             PlxCtsErrorDataReplication = 50004,
  218:  
  219:             /// <summary/>
  220:             PlxCtsErrorNodataFound = 50005,
  221:  
  222:             /// <summary/>
  223:             PlxCtsErrorUnauthorized = 50006,
  224:  
  225:             /// <summary/>
  226:             PlxCtsErrorRetryLater = 50007,
  227:  
  228:             /// <summary/>
  229:             PlxCtsErrorOverload = 50008,
  230:  
  231:             /// <summary/>
  232:             PlxCtsErrorDuplicateKey = 50009,
  233:  
  234:             /// <summary/>
  235:             PlxCtsErrorVersionMismatch = 50010,
  236:  
  237:             /// <summary/>
  238:             PlxCtsErrorUpdateLogOverrun = 50011,
  239:  
  240:             /// <summary/>
  241:             PlxCtsErrorUnexpectedState = 50012
  242:         }
  243:  
  244:         ////////////////////////////////////////////////////////////////////////////
  245:  
  246:         /// <summary>
  247:         ///
  248:         /// </summary>
  249:         public Ims()
  250:         {
  251:             // below: trust all certificates
  252:             // below: see http://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel
  253:  
  254:             System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);
  255:             //ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
  256:  
  257:             System.Net.ServicePointManager.Expect100Continue = true;
  258:             //System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
  259:             //System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  260:             System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
  261:         }
  262:  
  263:         ////////////////////////////////////////////////////////////////////////////
  264:  
  265:         /// <summary>
  266:         ///
  267:         /// </summary>
  268:         public string SessionId
  269:         {
  270:             get { return sessionId; }
  271:         }
  272:  
  273:         ////////////////////////////////////////////////////////////////////////////
  274:  
  275:         /// <summary>
  276:         ///
  277:         /// </summary>
  278:         public void ActUser(out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  279:         {
  280:             XmlDocument soapResultEnvelopeXmlDocument;
  281:  
  282:             SendSoapRequestAndReadResponse(ActUserSoapEnvelopeXml(sessionId), out soapResultEnvelopeXmlDocument);
  283:  
  284:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  285:         }
  286:  
  287:         ////////////////////////////////////////////////////////////////////////////
  288:  
  289:         /// <summary>
  290:         ///
  291:         /// </summary>
  292:         public void CancUser(out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  293:         {
  294:             XmlDocument soapResultEnvelopeXmlDocument;
  295:  
  296:             SendSoapRequestAndReadResponse(CancUserSoapEnvelopeXml(sessionId), out soapResultEnvelopeXmlDocument);
  297:  
  298:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  299:         }
  300:  
  301:         /*
  302:         ////////////////////////////////////////////////////////////////////////////
  303:         ////////////////////////////////////////////////////////////////////////////
  304: 
  305:         /// <summary>
  306:         ///
  307:         /// </summary>
  308:         public void EntNgfsAgcfGatewayRecordV2(int gwId, Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Model.Business.Nokia.Ims.Response response)
  309:         {
  310:             int tableId;
  311:             List<Dictionary<string, string>> parameterDictionaryList;
  312:             XmlDocument soapResultEnvelopeXmlDocument;
  313: 
  314:             tableId = Ia.Ftn.Cl.Model.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  315: 
  316:             SendSoapRequestAndReadResponse(EntNgcfAgcfGatewayRecordV2SoapEnvelopeXml(tableId, gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  317: 
  318:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out resultCode);
  319:         }
  320:         */
  321:  
  322:         ////////////////////////////////////////////////////////////////////////////
  323:  
  324:         /// <summary>
  325:         ///
  326:         /// </summary>
  327:         public Ia.Ftn.Cl.Models.Nokia.AgcfGatewayRecord RtrvNgfsAgcfGatewayRecordV2(int gwId, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  328:         {
  329:             XmlDocument soapResultEnvelopeXmlDocument;
  330:  
  331:             return RtrvNgfsAgcfGatewayRecordV2(gwId, out soapResultEnvelopeXmlDocument, out response);
  332:         }
  333:  
  334:         ////////////////////////////////////////////////////////////////////////////
  335:  
  336:         /// <summary>
  337:         ///
  338:         /// </summary>
  339:         public Ia.Ftn.Cl.Models.Nokia.AgcfGatewayRecord RtrvNgfsAgcfGatewayRecordV2(int gwId, out XmlDocument soapResultEnvelopeXmlDocument, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  340:         {
  341:             int tableId;
  342:             Ia.Ftn.Cl.Models.Nokia.AgcfGatewayRecord agcfGatewayRecord;
  343:  
  344:             tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  345:  
  346:             SendSoapRequestAndReadResponse(RtrvNgcfAgcfGatewayRecordV2SoapEnvelopeXml(tableId, gwId, sessionId), out soapResultEnvelopeXmlDocument);
  347:  
  348:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  349:  
  350:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  351:             {
  352:                 agcfGatewayRecord = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayRecord.ParseFromDictionary(response.ParameterDictionaryList[0]);
  353:             }
  354:             else agcfGatewayRecord = null;
  355:  
  356:             return agcfGatewayRecord;
  357:         }
  358:  
  359:         ////////////////////////////////////////////////////////////////////////////
  360:  
  361:         /// <summary>
  362:         ///
  363:         /// </summary>
  364:         public void DltNgfsAgcfGatewayRecordV2(int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  365:         {
  366:             int tableId;
  367:             XmlDocument soapResultEnvelopeXmlDocument;
  368:  
  369:             tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  370:  
  371:             SendSoapRequestAndReadResponse(DltNgcfAgcfGatewayRecordV2SoapEnvelopeXml(tableId, gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  372:  
  373:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  374:         }
  375:  
  376:         ////////////////////////////////////////////////////////////////////////////
  377:         ////////////////////////////////////////////////////////////////////////////
  378:  
  379:         /// <summary>
  380:         ///
  381:         /// </summary>
  382:         public void EntNgfsAgcfGwCombinedRecV2(int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont ont, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  383:         {
  384:             bool isExceeded;
  385:             int tableId;
  386:             XmlDocument soapResultEnvelopeXmlDocument;
  387:  
  388:             response = new Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response();
  389:  
  390:             // check if the number of AGCF gateway records for the MGC primary and secondary IP pair does not exceed the maximum recommended by Nokia
  391:  
  392:             isExceeded = Ia.Ftn.Cl.Models.Business.Nokia.Ims.MaximumCombinedNumberOfAgcfGatewayRecordsInAnyMgcIpAndMgcSecondaryIpPairIsExceeded(ont.MgcIp);
  393:  
  394:             if (!isExceeded)
  395:             {
  396:                 tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  397:  
  398:                 SendSoapRequestAndReadResponse(EntNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(tableId, gwId, ont, sessionId), out soapResultEnvelopeXmlDocument);
  399:  
  400:                 ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  401:             }
  402:             else
  403:             {
  404:                 response.ResultCode = Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.MaximumCombinedNumberOfAgcfGatewayRecordsInAnyMgcIpAndMgcSecondaryIpPairIsExceeded;
  405:             }
  406:         }
  407:  
  408:         ////////////////////////////////////////////////////////////////////////////
  409:  
  410:         /// <summary>
  411:         ///
  412:         /// </summary>
  413:         public void EdNgfsAgcfGatewayRecordV2_MateExternalIPAddr(int gwId, string mateExternalIPAddr, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  414:         {
  415:             int tableId;
  416:             XmlDocument soapResultEnvelopeXmlDocument;
  417:  
  418:             tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  419:  
  420:             SendSoapRequestAndReadResponse(EdNgfsAgcfGatewayRecordV2_MateExternalIPAddrSoapEnvelopeXml(tableId, gwId, mateExternalIPAddr, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  421:  
  422:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  423:         }
  424:  
  425:         ////////////////////////////////////////////////////////////////////////////
  426:  
  427:         /// <summary>
  428:         ///
  429:         /// </summary>
  430:         public void EdNgfsAgcfGatewayRecordV2_MateSite(int gwId, int mateSite, string primarySwitch, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  431:         {
  432:             int tableId;
  433:             XmlDocument soapResultEnvelopeXmlDocument;
  434:  
  435:             tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  436:  
  437:             SendSoapRequestAndReadResponse(EdNgfsAgcfGatewayRecordV2_MateSiteSoapEnvelopeXml(tableId, gwId, mateSite, primarySwitch, sessionId), out soapResultEnvelopeXmlDocument);
  438:  
  439:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  440:         }
  441:  
  442:         ////////////////////////////////////////////////////////////////////////////
  443:  
  444:         /// <summary>
  445:         ///
  446:         /// </summary>
  447:         public void EdNgfsAgcfGatewayRecordV2_IP1(int gwId, string ip1, string primarySwitch, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  448:         {
  449:             int tableId;
  450:             XmlDocument soapResultEnvelopeXmlDocument;
  451:  
  452:             tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  453:  
  454:             SendSoapRequestAndReadResponse(EdNgfsAgcfGatewayRecordV2_IP1SoapEnvelopeXml(tableId, gwId, ip1, primarySwitch, sessionId), out soapResultEnvelopeXmlDocument);
  455:  
  456:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  457:         }
  458:  
  459:         ////////////////////////////////////////////////////////////////////////////
  460:  
  461:         /// <summary>
  462:         ///
  463:         /// </summary>
  464:         public void DltNgfsAgcfGwCombinedRecV2(int gwId, string primarySwitch, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  465:         {
  466:             XmlDocument soapResultEnvelopeXmlDocument;
  467:  
  468:             DltNgfsAgcfGwCombinedRecV2(gwId, primarySwitch, out soapResultEnvelopeXmlDocument, out response);
  469:         }
  470:  
  471:         ////////////////////////////////////////////////////////////////////////////
  472:  
  473:         /// <summary>
  474:         ///
  475:         /// </summary>
  476:         public void DltNgfsAgcfGwCombinedRecV2(int gwId, string primarySwitch, out XmlDocument soapResultEnvelopeXmlDocument, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  477:         {
  478:             int tableId;
  479:  
  480:             tableId = Ia.Ftn.Cl.Models.Business.Nokia.AgcfGatewayTable.NgfsAgcfGatewayTableAid;
  481:  
  482:             SendSoapRequestAndReadResponse(DltNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(tableId, gwId, primarySwitch, sessionId), out soapResultEnvelopeXmlDocument);
  483:  
  484:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  485:         }
  486:  
  487:         ////////////////////////////////////////////////////////////////////////////
  488:         ////////////////////////////////////////////////////////////////////////////
  489:  
  490:         /// <summary>
  491:         ///
  492:         /// </summary>
  493:         public void EntNgfsAgcfEndpointV2(string service, int gwId, int flatTermId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  494:         {
  495:             XmlDocument soapResultEnvelopeXmlDocument;
  496:  
  497:             SendSoapRequestAndReadResponse(EntNgfsAgcfEndpointV2SoapEnvelopeXml(service, gwId, flatTermId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  498:  
  499:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  500:         }
  501:  
  502:         ////////////////////////////////////////////////////////////////////////////
  503:  
  504:         /// <summary>
  505:         ///
  506:         /// </summary>
  507:         public List<Ia.Ftn.Cl.Models.Nokia.AgcfEndpoint> RtrvNgfsAgcfEndpointV2(string prividUser, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  508:         {
  509:             XmlDocument soapResultEnvelopeXmlDocument;
  510:             List<Ia.Ftn.Cl.Models.Nokia.AgcfEndpoint> agcfEndpointList;
  511:  
  512:             SendSoapRequestAndReadResponse(RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(prividUser, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  513:  
  514:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  515:  
  516:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  517:             {
  518:                 agcfEndpointList = Ia.Ftn.Cl.Models.Business.Nokia.AgcfEndpoint.ParseFromDictionary(response.ParameterDictionaryList);
  519:             }
  520:             else agcfEndpointList = null;
  521:  
  522:             return agcfEndpointList;
  523:         }
  524:  
  525:         ////////////////////////////////////////////////////////////////////////////
  526:  
  527:         /// <summary>
  528:         ///
  529:         /// </summary>
  530:         public List<Ia.Ftn.Cl.Models.Nokia.AgcfEndpoint> RtrvNgfsAgcfEndpointV2List(int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  531:         {
  532:             XmlDocument soapResultEnvelopeXmlDocument;
  533:             List<Ia.Ftn.Cl.Models.Nokia.AgcfEndpoint> agcfEndpointList;
  534:  
  535:             SendSoapRequestAndReadResponse(RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  536:  
  537:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  538:  
  539:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  540:             {
  541:                 agcfEndpointList = Ia.Ftn.Cl.Models.Business.Nokia.AgcfEndpoint.ParseFromDictionary(response.ParameterDictionaryList);
  542:             }
  543:             else agcfEndpointList = null;
  544:  
  545:             return agcfEndpointList;
  546:         }
  547:  
  548:         ////////////////////////////////////////////////////////////////////////////
  549:  
  550:         /// <summary>
  551:         ///
  552:         /// </summary>
  553:         public List<Ia.Ftn.Cl.Models.Nokia.AgcfEndpoint> RtrvNgfsAgcfEndpointV2List(int gwId, string primarySwitch, int imsService, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  554:         {
  555:             XmlDocument soapResultEnvelopeXmlDocument;
  556:             List<Ia.Ftn.Cl.Models.Nokia.AgcfEndpoint> agcfEndpointList;
  557:  
  558:             SendSoapRequestAndReadResponse(RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(gwId, primarySwitch, imsService, sessionId), out soapResultEnvelopeXmlDocument);
  559:  
  560:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  561:  
  562:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  563:             {
  564:                 agcfEndpointList = Ia.Ftn.Cl.Models.Business.Nokia.AgcfEndpoint.ParseFromDictionary(response.ParameterDictionaryList);
  565:             }
  566:             else agcfEndpointList = null;
  567:  
  568:             return agcfEndpointList;
  569:         }
  570:  
  571:         ////////////////////////////////////////////////////////////////////////////
  572:  
  573:         /// <summary>
  574:         ///
  575:         /// </summary>
  576:         public void EdNgfsAgcfEndpointV2_CallWaiting(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool serviceAssigned, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  577:         {
  578:             XmlDocument soapResultEnvelopeXmlDocument;
  579:  
  580:             SendSoapRequestAndReadResponse(EdNgfsAgcfEndpointV2SoapEnvelopeXml_CallWaiting(service, nddOnt, serviceAssigned, sessionId), out soapResultEnvelopeXmlDocument);
  581:  
  582:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  583:         }
  584:  
  585:         ////////////////////////////////////////////////////////////////////////////
  586:  
  587:         /// <summary>
  588:         ///
  589:         /// </summary>
  590:         public void DltNgfsAgcfEndpointV2(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  591:         {
  592:             XmlDocument soapResultEnvelopeXmlDocument;
  593:  
  594:             SendSoapRequestAndReadResponse(DltNgfsAgcfEndpointV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  595:  
  596:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  597:         }
  598:  
  599:         ////////////////////////////////////////////////////////////////////////////
  600:  
  601:         /// <summary>
  602:         ///
  603:         /// </summary>
  604:         public void DltNgfsAgcfEndpointV2(string service, string primarySwitch, string fsdb, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  605:         {
  606:             XmlDocument soapResultEnvelopeXmlDocument;
  607:  
  608:             SendSoapRequestAndReadResponse(DltNgfsAgcfEndpointV2SoapEnvelopeXml(service, primarySwitch, fsdb, sessionId), out soapResultEnvelopeXmlDocument);
  609:  
  610:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  611:         }
  612:  
  613:         /*
  614:         ////////////////////////////////////////////////////////////////////////////
  615:         ////////////////////////////////////////////////////////////////////////////
  616: 
  617:         /// <summary>
  618:         ///
  619:         /// </summary>
  620:         public void EntNgfsSubPartyV2(string service, Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Model.Business.Nokia.Ims.Response response)
  621:         {
  622:             // Not used. Subparty is created and deleted with subscriber
  623:             XmlDocument soapResultEnvelopeXmlDocument;
  624: 
  625:             SendSoapRequestAndReadResponse(EntNgfsSubPartyV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  626: 
  627:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  628:         }
  629:         */
  630:  
  631:         ////////////////////////////////////////////////////////////////////////////
  632:  
  633:         /// <summary>
  634:         ///
  635:         /// </summary>
  636:         public Ia.Ftn.Cl.Models.Nokia.SubParty RtrvNgfsSubPartyV2(string partyId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  637:         {
  638:             XmlDocument soapResultEnvelopeXmlDocument;
  639:             Ia.Ftn.Cl.Models.Nokia.SubParty subParty;
  640:  
  641:             SendSoapRequestAndReadResponse(RtrvNgfsSubPartyV2SoapEnvelopeXml(partyId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  642:  
  643:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  644:  
  645:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  646:             {
  647:                 subParty = Ia.Ftn.Cl.Models.Business.Nokia.SubParty.ParseFromDictionary(response.ParameterDictionaryList[0]);
  648:             }
  649:             else subParty = null;
  650:  
  651:             return subParty;
  652:         }
  653:  
  654:         ////////////////////////////////////////////////////////////////////////////
  655:  
  656:         /// <summary>
  657:         ///
  658:         /// </summary>
  659:         public Ia.Ftn.Cl.Models.Nokia.SubParty RtrvNgfsSubPartyV2(string partyId, string primarySwitch, int imsService, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  660:         {
  661:             XmlDocument soapResultEnvelopeXmlDocument;
  662:             Ia.Ftn.Cl.Models.Nokia.SubParty subParty;
  663:  
  664:             SendSoapRequestAndReadResponse(RtrvNgfsSubPartyV2SoapEnvelopeXml(partyId, primarySwitch, imsService, sessionId), out soapResultEnvelopeXmlDocument);
  665:  
  666:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  667:  
  668:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  669:             {
  670:                 subParty = Ia.Ftn.Cl.Models.Business.Nokia.SubParty.ParseFromDictionary(response.ParameterDictionaryList[0]);
  671:             }
  672:             else subParty = null;
  673:  
  674:             return subParty;
  675:         }
  676:  
  677:         ////////////////////////////////////////////////////////////////////////////
  678:  
  679:         /// <summary>
  680:         ///
  681:         /// </summary>
  682:         public void DltNgfsSubPartyV2(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  683:         {
  684:             // Not used. Subparty is created and deleted with subscriber
  685:             XmlDocument soapResultEnvelopeXmlDocument;
  686:  
  687:             SendSoapRequestAndReadResponse(DltNgfsSubPartyV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  688:  
  689:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  690:         }
  691:  
  692:         ////////////////////////////////////////////////////////////////////////////
  693:         ////////////////////////////////////////////////////////////////////////////
  694:  
  695:         /// <summary>
  696:         ///
  697:         /// </summary>
  698:         public void EntNgfsSubscriberAndNgfsSubPartyV2_H248(string service, int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  699:         {
  700:             bool isSip;
  701:             XmlDocument soapResultEnvelopeXmlDocument;
  702:  
  703:             isSip = false; // this is not SIP
  704:  
  705:             SendSoapRequestAndReadResponse(EntNgfsSubscriberV2SoapEnvelopeXml(service, isSip, gwId, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  706:  
  707:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  708:         }
  709:  
  710:         ////////////////////////////////////////////////////////////////////////////
  711:  
  712:         /// <summary>
  713:         ///
  714:         /// </summary>
  715:         public void EntNgfsSubscriberAndNgfsSubPartyV2_Sip(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  716:         {
  717:             bool isSip;
  718:             XmlDocument soapResultEnvelopeXmlDocument;
  719:  
  720:             isSip = true; // this is SIP
  721:  
  722:             SendSoapRequestAndReadResponse(EntNgfsSubscriberV2SoapEnvelopeXml(service, isSip, 0, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  723:  
  724:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  725:         }
  726:  
  727:         ////////////////////////////////////////////////////////////////////////////
  728:  
  729:         /// <summary>
  730:         ///
  731:         /// </summary>
  732:         public Ia.Ftn.Cl.Models.Nokia.Subscriber RtrvNgfsSubscriberV2(string aid, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  733:         {
  734:             XmlDocument soapResultEnvelopeXmlDocument;
  735:             Ia.Ftn.Cl.Models.Nokia.Subscriber subscriber;
  736:  
  737:             SendSoapRequestAndReadResponse(RtrvNgfsSubscriberV2SoapEnvelopeXml(aid, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  738:  
  739:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  740:  
  741:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  742:             {
  743:                 subscriber = Ia.Ftn.Cl.Models.Business.Nokia.Subscriber.ParseFromDictionary(response.ParameterDictionaryList[0]);
  744:             }
  745:             else subscriber = null;
  746:  
  747:             return subscriber;
  748:         }
  749:  
  750:         ////////////////////////////////////////////////////////////////////////////
  751:  
  752:         /// <summary>
  753:         ///
  754:         /// </summary>
  755:         public Ia.Ftn.Cl.Models.Nokia.Subscriber RtrvNgfsSubscriberV2(string aid, string primarySwitch, int imsService, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  756:         {
  757:             XmlDocument soapResultEnvelopeXmlDocument;
  758:             Ia.Ftn.Cl.Models.Nokia.Subscriber subscriber;
  759:  
  760:             SendSoapRequestAndReadResponse(RtrvNgfsSubscriberV2SoapEnvelopeXml(aid, primarySwitch, imsService, sessionId), out soapResultEnvelopeXmlDocument);
  761:  
  762:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  763:  
  764:             if (response.ResultCode == Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful)
  765:             {
  766:                 subscriber = Ia.Ftn.Cl.Models.Business.Nokia.Subscriber.ParseFromDictionary(response.ParameterDictionaryList[0]);
  767:             }
  768:             else subscriber = null;
  769:  
  770:             return subscriber;
  771:         }
  772:  
  773:         ////////////////////////////////////////////////////////////////////////////
  774:  
  775:         /// <summary>
  776:         ///
  777:         /// </summary>
  778:         public void DltNgfsSubscriberAndNgfsSubPartyV2(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  779:         {
  780:             XmlDocument soapResultEnvelopeXmlDocument;
  781:  
  782:             SendSoapRequestAndReadResponse(DltNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  783:  
  784:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  785:         }
  786:  
  787:         ////////////////////////////////////////////////////////////////////////////
  788:  
  789:         /// <summary>
  790:         ///
  791:         /// </summary>
  792:         public void DltNgfsSubscriberAndNgfsSubPartyV2(string service, string primarySwitch, string fsdb, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  793:         {
  794:             XmlDocument soapResultEnvelopeXmlDocument;
  795:  
  796:             SendSoapRequestAndReadResponse(DltNgfsSubscriberV2SoapEnvelopeXml(service, primarySwitch, fsdb, sessionId), out soapResultEnvelopeXmlDocument);
  797:  
  798:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  799:         }
  800:  
  801:         ////////////////////////////////////////////////////////////////////////////
  802:  
  803:         /// <summary>
  804:         ///
  805:         /// </summary>
  806:         public void EdNgfsSubscriberV2_CallingLineId(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool callingLineIdState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  807:         {
  808:             string xml;
  809:             XmlDocument soapResultEnvelopeXmlDocument;
  810:  
  811:             xml = CallingLineIdXml(service, callingLineIdState);
  812:  
  813:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  814:  
  815:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  816:         }
  817:  
  818:         ////////////////////////////////////////////////////////////////////////////
  819:  
  820:         /// <summary>
  821:         ///
  822:         /// </summary>
  823:         public void EdNgfsSubscriberV2_OneDigitSpeedDial(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool oneDigitSpeedDialState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  824:         {
  825:             string xml;
  826:             XmlDocument soapResultEnvelopeXmlDocument;
  827:  
  828:             xml = OneDigitSpeedDial(service, oneDigitSpeedDialState);
  829:  
  830:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  831:  
  832:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  833:         }
  834:  
  835:         ////////////////////////////////////////////////////////////////////////////
  836:  
  837:         /// <summary>
  838:         ///
  839:         /// </summary>
  840:         public void EdNgfsSubscriberV2_CallForwardingVari(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool callForwardingState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  841:         {
  842:             string xml;
  843:             XmlDocument soapResultEnvelopeXmlDocument;
  844:  
  845:             xml = CallForwardingVariXml(service, callForwardingState);
  846:  
  847:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  848:  
  849:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  850:         }
  851:  
  852:         ////////////////////////////////////////////////////////////////////////////
  853:  
  854:         /// <summary>
  855:         ///
  856:         /// </summary>
  857:         public void EdNgfsSubscriberV2_CallWaiting(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool callWaitingState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  858:         {
  859:             string xml;
  860:             XmlDocument soapResultEnvelopeXmlDocument;
  861:  
  862:             xml = CallWaitingXml(service, callWaitingState);
  863:  
  864:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  865:  
  866:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  867:         }
  868:  
  869:         ////////////////////////////////////////////////////////////////////////////
  870:  
  871:         /// <summary>
  872:         ///
  873:         /// </summary>
  874:         public void EdNgfsSubscriberV2_ConferenceCall(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool conferenceCallState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  875:         {
  876:             string xml;
  877:             XmlDocument soapResultEnvelopeXmlDocument;
  878:  
  879:             xml = ConferenceCallingXml(service, conferenceCallState);
  880:  
  881:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  882:  
  883:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  884:         }
  885:  
  886:         ////////////////////////////////////////////////////////////////////////////
  887:  
  888:         /// <summary>
  889:         ///
  890:         /// </summary>
  891:         public void EdNgfsSubscriberV2_ReminderCall(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool reminderCallState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  892:         {
  893:             string xml;
  894:             XmlDocument soapResultEnvelopeXmlDocument;
  895:  
  896:             xml = ReminderCallXml(service, reminderCallState);
  897:  
  898:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  899:  
  900:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  901:         }
  902:  
  903:         ////////////////////////////////////////////////////////////////////////////
  904:  
  905:         /// <summary>
  906:         ///
  907:         /// </summary>
  908:         public void EdNgfsSubscriberV2_InternationalCalling(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool internationalCallingState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  909:         {
  910:             string xml;
  911:             XmlDocument soapResultEnvelopeXmlDocument;
  912:  
  913:             xml = InternationalCallingXml(service, internationalCallingState);
  914:  
  915:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  916:  
  917:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  918:         }
  919:  
  920:         ////////////////////////////////////////////////////////////////////////////
  921:  
  922:         /// <summary>
  923:         ///
  924:         /// </summary>
  925:         public void EdNgfsSubscriberV2_InternationalCallingUserControlled(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool internationalCallBarringState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  926:         {
  927:             string xml;
  928:             XmlDocument soapResultEnvelopeXmlDocument;
  929:  
  930:             xml = InternationalCallingUserControlledXml(service, internationalCallBarringState);
  931:  
  932:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2SoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  933:  
  934:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  935:         }
  936:  
  937:         ////////////////////////////////////////////////////////////////////////////
  938:  
  939:         /// <summary>
  940:         ///
  941:         /// </summary>
  942:         public void EdNgfsSubscriberV2_ServiceSuspension(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool serviceSuspensionState, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  943:         {
  944:             string xml;
  945:             XmlDocument soapResultEnvelopeXmlDocument;
  946:  
  947:             xml = ServiceSuspension(serviceSuspensionState);
  948:  
  949:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2WithinSubPartySoapEnvelopeXml(service, nddOnt, sessionId, xml), out soapResultEnvelopeXmlDocument);
  950:  
  951:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  952:         }
  953:  
  954:         ////////////////////////////////////////////////////////////////////////////
  955:  
  956:         /// <summary>
  957:         ///
  958:         /// </summary>
  959:         public void EdNgfsSubscriberAndNgfsSubPartyV2_H248ToSip(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
  960:         {
  961:             XmlDocument soapResultEnvelopeXmlDocument;
  962:  
  963:             SendSoapRequestAndReadResponse(EdNgfsSubscriberV2_H248ToSipSoapEnvelopeXml(service, nddOnt, sessionId), out soapResultEnvelopeXmlDocument);
  964:  
  965:             ParseSoapResultXml(soapResultEnvelopeXmlDocument, out response);
  966:         }
  967:  
  968:         ////////////////////////////////////////////////////////////////////////////
  969:         ////////////////////////////////////////////////////////////////////////////
  970:  
  971:  
  972:  
  973:  
  974:  
  975:  
  976:  
  977:  
  978:         ////////////////////////////////////////////////////////////////////////////
  979:         ////////////////////////////////////////////////////////////////////////////
  980:  
  981:         /// <summary>
  982:         ///
  983:         /// </summary>
  984:         private static XmlDocument ActUserSoapEnvelopeXml(string sessionId)
  985:         {
  986:             XmlDocument soapEnvelopeXml;
  987:             Dictionary<string, string> param;
  988:  
  989:             param = new Dictionary<string, string>();
  990:  
  991:             param.Add("UserName", Ia.Ftn.Cl.Models.Business.Nokia.Ims.UserName);
  992:             param.Add("PassWord", Ia.Ftn.Cl.Models.Business.Nokia.Ims.Password);
  993:  
  994:             soapEnvelopeXml = SoapEnvelopeXml("act-user", param, sessionId, "", "TECICS01", "fsdb0");
  995:  
  996:             return soapEnvelopeXml;
  997:         }
  998:  
  999:         ////////////////////////////////////////////////////////////////////////////
 1000:  
 1001:         /// <summary>
 1002:         ///
 1003:         /// <remarks>
 1004:         ///   <PlexViewRequest Command="canc-user" SwitchName="" RequestId="" SessionId="test:2012917080">
 1005:         ///   </PlexViewRequest>
 1006:         /// </remarks>
 1007:         /// </summary>
 1008:         private static XmlDocument CancUserSoapEnvelopeXml(string sessionId)
 1009:         {
 1010:             XmlDocument soapEnvelopeXml;
 1011:  
 1012:             soapEnvelopeXml = SoapEnvelopeXml("canc-user", "", sessionId, "", "TECICS01", "fsdb0");
 1013:  
 1014:             return soapEnvelopeXml;
 1015:         }
 1016:  
 1017:         /*
 1018:         ////////////////////////////////////////////////////////////////////////////
 1019:         ////////////////////////////////////////////////////////////////////////////
 1020: 
 1021:         /// <summary>
 1022:         ///
 1023:         /// <remarks>
 1024:         /// </remarks>
 1025:         /// </summary>
 1026:         private static XmlDocument EntNgcfAgcfGatewayRecordV2SoapEnvelopeXml(int tableId, int gwId, Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1027:         {
 1028:             int serviceProfileNumber;
 1029:             string xmlContent, puid, ip1, ip2, pridUser, privateId, prsetName, prsetNumber, prsetNum, gwUserId, gwName, agcfSipIaPort;
 1030:             XmlDocument soapEnvelopeXml;
 1031: 
 1032:             puid = "sip:rgw" + gwId;
 1033:             pridUser = "rgw" + gwId;
 1034:             privateId = "rgw" + gwId;
 1035:             prsetName = "rgw" + gwId;
 1036:             prsetNumber = gwId.ToString();
 1037:             prsetNum = gwId.ToString();
 1038:             gwUserId = "rgw" + gwId;
 1039:             gwName = "rgw" + gwId;
 1040:             ip1 = nddOnt.Ip; // "1.4.150.2";
 1041:             ip2 = "0.0.0.0";
 1042: 
 1043:             serviceProfileNumber = Ia.Ftn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumberAgcfGatewayRecord(nddOnt.Pon.PonGroup.Olt.ImsService);
 1044:             agcfSipIaPort = Ia.Ftn.Cl.Model.Business.Nokia.Ims.AgcfSipIaPort(nddOnt.Pon.PonGroup.Olt.ImsService);
 1045: 
 1046:             xmlContent = @"
 1047:     <AgcfGatewayRecord>
 1048:     <TableId>" + tableId + @"</TableId>
 1049:     <GwId>" + gwId + @"</GwId>
 1050:     <GwUserId>" + gwUserId + @"</GwUserId>
 1051:     <GwName>" + gwName + @"</GwName>
 1052:     <IP1>" + ip1 + @"</IP1>
 1053:     <IP2>" + ip2 + @"</IP2>
 1054:     <AgcfSipIaPort>" + agcfSipIaPort + @"</AgcfSipIaPort>
 1055:     <ConnectionType>UDP/IP</ConnectionType>
 1056:     <ContextAudits>Audit Value Based</ContextAudits>
 1057:     <GwDigitMapId>1</GwDigitMapId>
 1058:     <EnableChannelStatusAudits>false</EnableChannelStatusAudits>
 1059:     <GwDomain>ims.moc1.kw</GwDomain>
 1060:     <GwPrivId></GwPrivId>
 1061:     <LocalTermTypePrefix>td</LocalTermTypePrefix>
 1062:     <LocalTermTypeAnalogPrefix>td</LocalTermTypeAnalogPrefix>
 1063:     <IsLocalTermTypeTDMAnalog>true</IsLocalTermTypeTDMAnalog>
 1064:     <NetTermTypePrefix>RTP/</NetTermTypePrefix>
 1065:     <IsNetTermTypeRTPUDP>true</IsNetTermTypeRTPUDP>
 1066:     <PhysicalTermIdScheme>Flat Term ID</PhysicalTermIdScheme>
 1067:     <SendCompactMessages>true</SendCompactMessages>
 1068:     <SendEphemeralPrefix>false</SendEphemeralPrefix>
 1069:     <UdpPort>2944</UdpPort>
 1070:     <GwVariantId>1</GwVariantId>
 1071:     <AreaId>0</AreaId>
 1072:     <ComfortNoise>false</ComfortNoise>
 1073:     <Dtmf>false</Dtmf>
 1074:     <FaxEvents>false</FaxEvents>
 1075:     <ModemEvents>false</ModemEvents>
 1076:     <TextTelephonyEvents>false</TextTelephonyEvents>
 1077:     <AllCodecDataStr>Audio|G.711 - uLaw|20|false</AllCodecDataStr>
 1078:     <AgwIuaIpAddress></AgwIuaIpAddress>
 1079:     <AgwIuaSctpPort></AgwIuaSctpPort>
 1080:     <AgcfLocalSctpPort></AgcfLocalSctpPort>
 1081:     <SctpProfile></SctpProfile>
 1082:     <IuaIIDMapScheme></IuaIIDMapScheme>
 1083:     <LocalTermTypeIsdnPrefix></LocalTermTypeIsdnPrefix>
 1084:     <AuditAllActiveIsdnCalls>false</AuditAllActiveIsdnCalls>
 1085:     <MateSite>2</MateSite>
 1086:     <MateExternalIPAddr>10.16.5.31</MateExternalIPAddr>
 1087:     <IsPrimary>true</IsPrimary>
 1088:     <AddtionalDigitMapList></AddtionalDigitMapList>
 1089:     <AuthTimer>10</AuthTimer>
 1090:     <SharedBasNumber>101</SharedBasNumber>
 1091:     <SharedPriNumber>523</SharedPriNumber>
 1092:     <MgID></MgID>
 1093:     <EnnableMD5DigAuteh>false</EnnableMD5DigAuteh>
 1094:     <ChannelAudits>Arming Modify and AuditValue done one after another sequentially</ChannelAudits>
 1095:     <GroupId>1</GroupId>
 1096:     <AgcfGateWayType>RGW/iAD</AgcfGateWayType>
 1097:     </AgcfGatewayRecord>
 1098: 
 1099:     <HSSPrivateId>
 1100:         <PridUser>" + pridUser + @"</PridUser>
 1101:         <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
 1102:         <PuidUserList>
 1103:             <HSSPublicId>
 1104:                 <Puid>" + puid + @"</Puid>
 1105:                 <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
 1106:             </HSSPublicId>
 1107:         </PuidUserList>
 1108:     </HSSPrivateId>
 1109: 
 1110: ";
 1111: 
 1112:             soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", nddOnt.Pon.PonGroup.Olt.PrimarySwitch, nddOnt.Pon.PonGroup.Olt.ImsFsdb);
 1113: 
 1114:             return soapEnvelopeXml;
 1115:         }
 1116:         */
 1117:  
 1118:         ////////////////////////////////////////////////////////////////////////////
 1119:         ////////////////////////////////////////////////////////////////////////////
 1120:  
 1121:         /// <summary>
 1122:         ///
 1123:         /// <remarks>
 1124:         /// </remarks>
 1125:         /// </summary>
 1126:         private static XmlDocument EntNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(int tableId, int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1127:         {
 1128:             int serviceProfileNumber;
 1129:             string xmlContent, puid, ip1, ip2, mgcIp, mgcSecondaryIp, pridUser, privateId, prsetName, prsetNumber, prsetNum, gwUserId, gwName, agcfSipIaPort;
 1130:             XmlDocument soapEnvelopeXml;
 1131:  
 1132:             puid = "sip:rgw" + gwId;
 1133:             pridUser = "rgw" + gwId;
 1134:             privateId = "rgw" + gwId;
 1135:             prsetName = "rgw" + gwId;
 1136:             prsetNumber = gwId.ToString();
 1137:             prsetNum = gwId.ToString();
 1138:             gwUserId = "rgw" + gwId;
 1139:             gwName = "rgw" + gwId;
 1140:             ip1 = nddOnt.Ip; // "1.4.150.2";
 1141:             ip2 = "0.0.0.0";
 1142:             mgcIp = nddOnt.MgcIp;
 1143:             mgcSecondaryIp = nddOnt.MgcSecondaryIp;
 1144:  
 1145:             agcfSipIaPort = Ia.Ftn.Cl.Models.Business.Nokia.Ims.AgcfSipIaPort(nddOnt.ImsService);
 1146:             serviceProfileNumber = Ia.Ftn.Cl.Models.Business.Nokia.Ims.ServiceProfileNumberAgcfGatewayRecord(nddOnt.ImsService);
 1147:  
 1148:             xmlContent = @"
 1149:     <AgcfGatewayRecord>
 1150:         <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
 1151:         <TableId>" + tableId + @"</TableId>
 1152:         <GwId>" + gwId + @"</GwId>
 1153:         <AgcfSipIaPort>" + agcfSipIaPort + @"</AgcfSipIaPort>
 1154:         <GwUserId>" + gwUserId + @"</GwUserId>
 1155:         <GwName>" + gwName + @"</GwName>
 1156:         <IP1>" + ip1 + @"</IP1>
 1157:         <IP2>" + ip2 + @"</IP2>
 1158:         <MateExternalIPAddr>" + mgcSecondaryIp + @"</MateExternalIPAddr>
 1159:         <ConnectionType>UDP/IP</ConnectionType>
 1160:         <ContextAudits>Audit Value Based</ContextAudits>
 1161:         <GwDigitMapId>1</GwDigitMapId>
 1162:         <EnableChannelStatusAudits>false</EnableChannelStatusAudits>
 1163:         <GwDomain>ims.moc1.kw</GwDomain>
 1164:         <GwPrivId></GwPrivId>
 1165:         <LocalTermTypePrefix>td</LocalTermTypePrefix>
 1166:         <LocalTermTypeAnalogPrefix>td</LocalTermTypeAnalogPrefix>
 1167:         <IsLocalTermTypeTDMAnalog>true</IsLocalTermTypeTDMAnalog>
 1168:         <NetTermTypePrefix>RTP</NetTermTypePrefix>
 1169:         <IsNetTermTypeRTPUDP>true</IsNetTermTypeRTPUDP>
 1170:         <PhysicalTermIdScheme>Flat Term ID</PhysicalTermIdScheme>
 1171:         <SendCompactMessages>true</SendCompactMessages>
 1172:         <SendEphemeralPrefix>false</SendEphemeralPrefix>
 1173:         <UdpPort>2944</UdpPort>
 1174:         <GwVariantId>1</GwVariantId>
 1175:         <AreaId>0</AreaId>
 1176:         <ComfortNoise>false</ComfortNoise>
 1177:         <Dtmf>false</Dtmf>
 1178:         <FaxEvents>false</FaxEvents>
 1179:         <ModemEvents>false</ModemEvents>
 1180:         <TextTelephonyEvents>false</TextTelephonyEvents>
 1181:         <AllCodecDataStr>Audio|G.711 - uLaw|20|false</AllCodecDataStr>
 1182:         <AgwIuaIpAddress></AgwIuaIpAddress>
 1183:         <AgwIuaSctpPort></AgwIuaSctpPort>
 1184:         <AgcfLocalSctpPort></AgcfLocalSctpPort>
 1185:         <SctpProfile></SctpProfile>
 1186:         <IuaIIDMapScheme></IuaIIDMapScheme>
 1187:         <LocalTermTypeIsdnPrefix></LocalTermTypeIsdnPrefix>
 1188:         <AuditAllActiveIsdnCalls>false</AuditAllActiveIsdnCalls>
 1189:         <MateSite>2</MateSite>
 1190:         <IsPrimary>true</IsPrimary>
 1191:         <AddtionalDigitMapList></AddtionalDigitMapList>
 1192:         <AuthTimer>10</AuthTimer>
 1193:         <SharedBasNumber>101</SharedBasNumber>
 1194:         <SharedPriNumber>523</SharedPriNumber>
 1195:         <MgID></MgID>
 1196:         <EnnableMD5DigAuteh>false</EnnableMD5DigAuteh>
 1197:         <ChannelAudits>Arming Modify and AuditValue done one after another sequentially</ChannelAudits>
 1198:         <GroupId>1</GroupId>
 1199:         <AgcfGateWayType>RGW/iAD</AgcfGateWayType>
 1200:     </AgcfGatewayRecord>
 1201:  
 1202:     <HSSPrivateId>
 1203:         <PridUser>" + pridUser + @"</PridUser>
 1204:         <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
 1205:         <PrivPassword>1234</PrivPassword>
 1206:         <PridDomainId>0</PridDomainId>
 1207:         <PridDomainName>ims.moc1.kw</PridDomainName>
 1208:         <ServerCapNumber>0</ServerCapNumber>
 1209:         <ProtectionGroupNumber>1</ProtectionGroupNumber>
 1210:         <ChargeInfoNum>0</ChargeInfoNum>
 1211:         <MediaProfileId>0</MediaProfileId>
 1212:         <PuidUserList>
 1213:             <HSSPublicId>
 1214:                 <Puid>" + puid + @"</Puid>
 1215:                 <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
 1216:                 <PrivateId>" + privateId + @"</PrivateId>
 1217:                 <PuidDomainName>ims.moc1.kw</PuidDomainName>
 1218:                 <PridDomainName>ims.moc1.kw</PridDomainName>
 1219:                 <IsWildcardPuid>false</IsWildcardPuid>
 1220:                 <Barring>true</Barring>
 1221:                 <ImplRegSet>1</ImplRegSet>
 1222:                 <Authorized>true</Authorized>
 1223:                 <SendTelURI>false</SendTelURI>
 1224:             </HSSPublicId>
 1225:         </PuidUserList>
 1226:     </HSSPrivateId>
 1227:  
 1228:     <HSSPrset>
 1229:         <PrsetNum>" + prsetNum + @"</PrsetNum>
 1230:         <PridUser>" + pridUser + @"</PridUser>
 1231:         <PrsetName>" + prsetName + @"</PrsetName>
 1232:         <PridDomain>ims.moc1.kw</PridDomain>
 1233:         <ServerCapNum>0</ServerCapNum>
 1234:     </HSSPrset>
 1235:  
 1236:     <GeoRedundancyData>
 1237:         <AgcfGatewayRecord>
 1238:             <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
 1239:             <TableId>" + tableId + @"</TableId>
 1240:             <GwId>" + gwId + @"</GwId>
 1241:             <AgcfSipIaPort>" + agcfSipIaPort + @"</AgcfSipIaPort>
 1242:             <GwUserId>" + gwUserId + @"</GwUserId>
 1243:             <GwName>" + gwName + @"</GwName>
 1244:             <IP1>" + ip1 + @"</IP1>
 1245:             <IP2>" + ip2 + @"</IP2>
 1246:              <MateExternalIPAddr>" + mgcIp + @"</MateExternalIPAddr>
 1247:             <ConnectionType>UDP/IP</ConnectionType>
 1248:             <ContextAudits>Audit Value Based</ContextAudits>
 1249:             <GwDigitMapId>1</GwDigitMapId>
 1250:             <EnableChannelStatusAudits>false</EnableChannelStatusAudits>
 1251:             <GwDomain>ims.moc1.kw</GwDomain>
 1252:             <GwPrivId></GwPrivId>
 1253:             <LocalTermTypePrefix>td</LocalTermTypePrefix>
 1254:             <LocalTermTypeAnalogPrefix>td</LocalTermTypeAnalogPrefix>
 1255:             <IsLocalTermTypeTDMAnalog>true</IsLocalTermTypeTDMAnalog>
 1256:             <NetTermTypePrefix>RTP</NetTermTypePrefix>
 1257:             <IsNetTermTypeRTPUDP>true</IsNetTermTypeRTPUDP>
 1258:             <PhysicalTermIdScheme>Flat Term ID</PhysicalTermIdScheme>
 1259:             <SendCompactMessages>true</SendCompactMessages>
 1260:             <SendEphemeralPrefix>false</SendEphemeralPrefix>
 1261:             <UdpPort>2944</UdpPort>
 1262:             <GwVariantId>1</GwVariantId>
 1263:             <AreaId>0</AreaId>
 1264:             <ComfortNoise>false</ComfortNoise>
 1265:             <Dtmf>false</Dtmf>
 1266:             <FaxEvents>false</FaxEvents>
 1267:             <ModemEvents>false</ModemEvents>
 1268:             <TextTelephonyEvents>false</TextTelephonyEvents>
 1269:             <AllCodecDataStr>Audio|G.711 - uLaw|20|false</AllCodecDataStr>
 1270:             <AgwIuaIpAddress></AgwIuaIpAddress>
 1271:             <AgwIuaSctpPort></AgwIuaSctpPort>
 1272:             <AgcfLocalSctpPort></AgcfLocalSctpPort>
 1273:             <SctpProfile></SctpProfile>
 1274:             <IuaIIDMapScheme></IuaIIDMapScheme>
 1275:             <LocalTermTypeIsdnPrefix></LocalTermTypeIsdnPrefix>
 1276:             <AuditAllActiveIsdnCalls>false</AuditAllActiveIsdnCalls>
 1277:             <MateSite>2</MateSite>
 1278:             <IsPrimary>false</IsPrimary>
 1279:             <AddtionalDigitMapList></AddtionalDigitMapList>
 1280:             <AuthTimer>10</AuthTimer>
 1281:             <SharedBasNumber>101</SharedBasNumber>
 1282:             <SharedPriNumber>523</SharedPriNumber>
 1283:             <MgID></MgID>
 1284:             <EnnableMD5DigAuteh>false</EnnableMD5DigAuteh>
 1285:             <ChannelAudits>Arming Modify and AuditValue done one after another sequentially</ChannelAudits>
 1286:             <GroupId>1</GroupId>
 1287:             <AgcfGateWayType>RGW/iAD</AgcfGateWayType>
 1288:         </AgcfGatewayRecord>
 1289:         <HSSPrivateId>
 1290:             <PridUser>" + pridUser + @"</PridUser>
 1291:             <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
 1292:             <PrivPassword>1234</PrivPassword>
 1293:             <PridDomainId>0</PridDomainId>
 1294:             <PridDomainName>ims.moc1.kw</PridDomainName>
 1295:             <ServerCapNumber>0</ServerCapNumber>
 1296:             <ProtectionGroupNumber>2</ProtectionGroupNumber>
 1297:             <ChargeInfoNum>0</ChargeInfoNum>
 1298:             <MediaProfileId>0</MediaProfileId>
 1299:             <PuidUserList>
 1300:                 <HSSPublicId>
 1301:                     <Puid>" + puid + @"</Puid>
 1302:                     <PrivateId>" + privateId + @"</PrivateId>
 1303:                     <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
 1304:                     <PuidDomainName>ims.moc1.kw</PuidDomainName>
 1305:                     <PridDomainName>ims.moc1.kw</PridDomainName>
 1306:                     <IsWildcardPuid>false</IsWildcardPuid>
 1307:                     <Barring>true</Barring>
 1308:                     <ImplRegSet>1</ImplRegSet>
 1309:                     <Authorized>true</Authorized>
 1310:                     <SendTelURI>false</SendTelURI>
 1311:                 </HSSPublicId>
 1312:             </PuidUserList>
 1313:         </HSSPrivateId>
 1314:         <HSSPrset>
 1315:             <PrsetNum>" + prsetNum + @"</PrsetNum>
 1316:             <PridUser>" + pridUser + @"</PridUser>
 1317:             <PrsetName>" + prsetName + @"</PrsetName>
 1318:             <PridDomain>ims.moc1.kw</PridDomain>
 1319:             <ServerCapNum>0</ServerCapNum>
 1320:         </HSSPrset>
 1321:     </GeoRedundancyData>";
 1322:  
 1323:             soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-agcfgwcombinedrec-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1324:  
 1325:             return soapEnvelopeXml;
 1326:         }
 1327:  
 1328:         ////////////////////////////////////////////////////////////////////////////
 1329:  
 1330:         /// <summary>
 1331:         ///
 1332:         /// <remarks>
 1333:         /// </remarks>
 1334:         /// </summary>
 1335:         private static XmlDocument EdNgfsAgcfGatewayRecordV2_MateExternalIPAddrSoapEnvelopeXml(int tableId, int gwId, string mateExternalIPAddr, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1336:         {
 1337:             string xmlContent;
 1338:             XmlDocument soapEnvelopeXml;
 1339:  
 1340:             xmlContent = @"
 1341:         <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
 1342:         <TableId>" + tableId + @"</TableId>
 1343:         <GwId>" + gwId + @"</GwId>
 1344:         <MateExternalIPAddr>" + mateExternalIPAddr + @"</MateExternalIPAddr>";
 1345:  
 1346:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1347:  
 1348:             return soapEnvelopeXml;
 1349:         }
 1350:  
 1351:         ////////////////////////////////////////////////////////////////////////////
 1352:  
 1353:         /// <summary>
 1354:         ///
 1355:         /// <remarks>
 1356:         /// </remarks>
 1357:         /// </summary>
 1358:         private static XmlDocument EdNgfsAgcfGatewayRecordV2_MateSiteSoapEnvelopeXml(int tableId, int gwId, int mateSite, string primarySwitch, string sessionId)
 1359:         {
 1360:             string xmlContent;
 1361:             XmlDocument soapEnvelopeXml;
 1362:  
 1363:             xmlContent = @"
 1364:         <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
 1365:         <TableId>" + tableId + @"</TableId>
 1366:         <GwId>" + gwId + @"</GwId>
 1367:         <MateSite>" + mateSite + @"</MateSite>";
 1368:  
 1369:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", primarySwitch); //, nddOnt.ImsFsdb);
 1370:  
 1371:             return soapEnvelopeXml;
 1372:         }
 1373:  
 1374:         ////////////////////////////////////////////////////////////////////////////
 1375:  
 1376:         /// <summary>
 1377:         ///
 1378:         /// <remarks>
 1379:         /// </remarks>
 1380:         /// </summary>
 1381:         private static XmlDocument EdNgfsAgcfGatewayRecordV2_IP1SoapEnvelopeXml(int tableId, int gwId, string ip1, string primarySwitch, string sessionId)
 1382:         {
 1383:             string xmlContent;
 1384:             XmlDocument soapEnvelopeXml;
 1385:  
 1386:             xmlContent = @"
 1387:         <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
 1388:         <TableId>" + tableId + @"</TableId>
 1389:         <GwId>" + gwId + @"</GwId>
 1390:         <IP1>" + ip1 + @"</IP1>";
 1391:  
 1392:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfgatewayrecord-v2", xmlContent, sessionId, "", primarySwitch); //, nddOnt.ImsFsdb);
 1393:  
 1394:             return soapEnvelopeXml;
 1395:         }
 1396:  
 1397:         ////////////////////////////////////////////////////////////////////////////
 1398:  
 1399:         /// <summary>
 1400:         ///
 1401:         /// <remarks>
 1402:         /// </remarks>
 1403:         /// </summary>
 1404:         private static XmlDocument DltNgfsAgcfGwCombinedRecV2SoapEnvelopeXml(int tableId, int gwId, string primarySwitch, string sessionId)
 1405:         {
 1406:             string xmlContent;
 1407:             XmlDocument soapEnvelopeXml;
 1408:  
 1409:             xmlContent = @"
 1410:     <AgcfGatewayRecord>
 1411:         <NgcfAgcfGatewayRecordAid>" + tableId + "`" + gwId + @"</NgcfAgcfGatewayRecordAid>
 1412:         <TableId>" + tableId + @"</TableId>
 1413:         <GwId>" + gwId + @"</GwId>
 1414:     </AgcfGatewayRecord>";
 1415:  
 1416:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfgwcombinedrec-v2", xmlContent, sessionId, "", primarySwitch); //, nddOnt.ImsFsdb);
 1417:  
 1418:             return soapEnvelopeXml;
 1419:         }
 1420:  
 1421:         ////////////////////////////////////////////////////////////////////////////
 1422:         ////////////////////////////////////////////////////////////////////////////
 1423:  
 1424:         /// <summary>
 1425:         ///
 1426:         /// <remarks>
 1427:         ///   <PlexViewRequest Command="rtrv-ngfs-agcfgatewayrecord-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
 1428:         ///     <NgcfAgcfGatewayRecordAid>6`2101</NgcfAgcfGatewayRecordAid>
 1429:         ///   </PlexViewRequest>
 1430:         /// </remarks>
 1431:         /// </summary>
 1432:         private static XmlDocument RtrvNgcfAgcfGatewayRecordV2SoapEnvelopeXml(int tableId, int gwId, string sessionId)
 1433:         {
 1434:             XmlDocument soapEnvelopeXml;
 1435:             Dictionary<string, string> param;
 1436:  
 1437:             param = new Dictionary<string, string>();
 1438:  
 1439:             param.Add("NgcfAgcfGatewayRecordAid", tableId + "`" + gwId);
 1440:  
 1441:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfgatewayrecord-v2", param, sessionId, "", Ia.Ftn.Cl.Models.Business.Nokia.Ims.AnyPrimarySwitch);
 1442:  
 1443:             return soapEnvelopeXml;
 1444:         }
 1445:  
 1446:         ////////////////////////////////////////////////////////////////////////////
 1447:  
 1448:         /// <summary>
 1449:         /// Read from SKB side
 1450:         /// <remarks>
 1451:         ///   <PlexViewRequest Command="rtrv-ngfs-agcfgatewayrecord-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
 1452:         ///     <NgcfAgcfGatewayRecordAid>6`2101</NgcfAgcfGatewayRecordAid>
 1453:         ///   </PlexViewRequest>
 1454:         /// </remarks>
 1455:         /// </summary>
 1456:         private static XmlDocument RtrvNgcfAgcfGatewayRecordFromSkbV2SoapEnvelopeXml(int tableId, int gwId, string sessionId)
 1457:         {
 1458:             XmlDocument soapEnvelopeXml;
 1459:             Dictionary<string, string> param;
 1460:  
 1461:             param = new Dictionary<string, string>();
 1462:  
 1463:             param.Add("NgcfAgcfGatewayRecordAid", tableId + "`" + gwId);
 1464:  
 1465:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfgatewayrecord-v2", param, sessionId, "", Ia.Ftn.Cl.Models.Business.Nokia.Ims.SKB);
 1466:  
 1467:             return soapEnvelopeXml;
 1468:         }
 1469:  
 1470:         ////////////////////////////////////////////////////////////////////////////
 1471:  
 1472:         /// <summary>
 1473:         ///
 1474:         /// <remarks>
 1475:         ///   <PlexViewRequest Command="dlt-ngfs-agcfgatewayrecord-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
 1476:         ///     <NgcfAgcfGatewayRecordAid>6`2101</NgcfAgcfGatewayRecordAid>
 1477:         ///   </PlexViewRequest>
 1478:         /// </remarks>
 1479:         /// </summary>
 1480:         private static XmlDocument DltNgcfAgcfGatewayRecordV2SoapEnvelopeXml(int tableId, int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1481:         {
 1482:             XmlDocument soapEnvelopeXml;
 1483:             Dictionary<string, string> param;
 1484:  
 1485:             param = new Dictionary<string, string>();
 1486:  
 1487:             param.Add("NgcfAgcfGatewayRecordAid", tableId + "`" + gwId);
 1488:  
 1489:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfgatewayrecord-v2", param, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1490:  
 1491:             return soapEnvelopeXml;
 1492:         }
 1493:  
 1494:         ////////////////////////////////////////////////////////////////////////////
 1495:         ////////////////////////////////////////////////////////////////////////////
 1496:  
 1497:         /// <summary>
 1498:         ///
 1499:         /// <remarks>
 1500:         /// </remarks>
 1501:         /// </summary>
 1502:         private static XmlDocument EntNgfsAgcfEndpointV2SoapEnvelopeXml(string service, int gwId, int flatTermId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1503:         {
 1504:             string xmlContent, prividUser, dn;
 1505:             XmlDocument soapEnvelopeXml;
 1506:  
 1507:             prividUser = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PrividUser(service);
 1508:             dn = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.Dn(service);
 1509:  
 1510:             xmlContent = @"
 1511:     <PrividUser>" + prividUser + @"</PrividUser>
 1512:     <GwId>" + gwId + @"</GwId>
 1513:     <Dn>" + dn + @"</Dn>
 1514:     <FlatTermID>" + flatTermId + @"</FlatTermID>
 1515:     <Slot>0</Slot>
 1516:     <Port>0</Port>
 1517:     <AdditionalDNs></AdditionalDNs>
 1518:     <DomainIndex>0</DomainIndex>
 1519:     <FeatureFlag>0</FeatureFlag>
 1520:     <DslamId></DslamId>
 1521:     <Rack>-1</Rack>
 1522:     <Shelf>0</Shelf>
 1523:     <SubscriberType>Analog</SubscriberType>
 1524:     <ReversePolarity>UPON_DIGIT_COLLECTION_ALWAYS</ReversePolarity>
 1525:     <PayphoneMetering>PAYPHONE_PULSE_METERING_16_KHZ</PayphoneMetering>
 1526:     <DigitMap1st>0</DigitMap1st>
 1527:     <DigitMap2nd>0</DigitMap2nd>
 1528:     <DialTone2nd>0</DialTone2nd>
 1529:     <CallHoldLc>true</CallHoldLc>
 1530:     <CallWaitingLc>false</CallWaitingLc>
 1531:     <CallToggleLc>true</CallToggleLc>
 1532:     <ThreeWayCallLc>true</ThreeWayCallLc>
 1533:     <McidLc>false</McidLc>
 1534:     <CallTransferLc>false</CallTransferLc>
 1535: ";
 1536:  
 1537:             soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1538:  
 1539:             return soapEnvelopeXml;
 1540:         }
 1541:  
 1542:         ////////////////////////////////////////////////////////////////////////////
 1543:  
 1544:         /// <summary>
 1545:         ///
 1546:         /// </summary>
 1547:         private static XmlDocument EdNgfsAgcfEndpointV2SoapEnvelopeXml_CallWaiting(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool serviceAssigned, string sessionId)
 1548:         {
 1549:             string xmlContent, prividUser, value;
 1550:             XmlDocument soapEnvelopeXml;
 1551:  
 1552:             prividUser = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PrividUser(service);
 1553:             value = Convert.ToString(serviceAssigned).ToLower();
 1554:  
 1555:             xmlContent = @"
 1556:     <PrividUser>" + prividUser + @"</PrividUser>
 1557:     <CallWaitingLc>" + value + @"</CallWaitingLc>
 1558: ";
 1559:  
 1560:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1561:  
 1562:             return soapEnvelopeXml;
 1563:         }
 1564:  
 1565:         ////////////////////////////////////////////////////////////////////////////
 1566:  
 1567:         /// <summary>
 1568:         ///
 1569:         /// <remarks>
 1570:         ///   <PlexViewRequest Command="rtrv-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1946199540" MaxRows="-1">
 1571:         ///   <PrividUser>priv_96522239100</PrividUser>
 1572:         ///   </PlexViewRequest>
 1573:         /// </remarks>
 1574:         /// </summary>
 1575:         private static XmlDocument RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(string prividUser, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1576:         {
 1577:             XmlDocument soapEnvelopeXml;
 1578:             Dictionary<string, string> param;
 1579:  
 1580:             param = new Dictionary<string, string>();
 1581:  
 1582:             param.Add("PrividUser", prividUser);
 1583:  
 1584:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfendpoint-v2", param, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1585:  
 1586:             return soapEnvelopeXml;
 1587:         }
 1588:  
 1589:         ////////////////////////////////////////////////////////////////////////////
 1590:  
 1591:         /// <summary>
 1592:         ///
 1593:         /// <remarks>
 1594:         /// <PlexViewRequest Command="rtrv-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb2" RequestId="" SessionId="ngnAPI:1313903573" MaxRows="4">
 1595:         ///   <filter>
 1596:         ///     <search>
 1597:         ///       <searchby>GwId</searchby>
 1598:         ///       <searchstring>2463</searchstring>
 1599:         ///       <operation>Equals</operation>
 1600:         ///       <caseSensitive>false</caseSensitive>
 1601:         ///     </search>
 1602:         ///   </filter>
 1603:         /// </PlexViewRequest>
 1604:         /// </remarks>
 1605:         /// </summary>
 1606:         private static XmlDocument RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1607:         {
 1608:             string xmlContent;
 1609:             XmlDocument soapEnvelopeXml;
 1610:  
 1611:             xmlContent = @"
 1612:     <filter>
 1613:         <search>
 1614:             <searchby>GwId</searchby>
 1615:             <searchstring>" + gwId + @"</searchstring>
 1616:             <operation>Equals</operation>
 1617:             <caseSensitive>false</caseSensitive>
 1618:         </search>
 1619:     </filter>
 1620: ";
 1621:  
 1622:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1623:  
 1624:             return soapEnvelopeXml;
 1625:         }
 1626:  
 1627:         ////////////////////////////////////////////////////////////////////////////
 1628:  
 1629:         /// <summary>
 1630:         ///
 1631:         /// <remarks>
 1632:         /// <PlexViewRequest Command="rtrv-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb2" RequestId="" SessionId="ngnAPI:1313903573" MaxRows="4">
 1633:         ///   <filter>
 1634:         ///     <search>
 1635:         ///       <searchby>GwId</searchby>
 1636:         ///       <searchstring>2463</searchstring>
 1637:         ///       <operation>Equals</operation>
 1638:         ///       <caseSensitive>false</caseSensitive>
 1639:         ///     </search>
 1640:         ///   </filter>
 1641:         /// </PlexViewRequest>
 1642:         /// </remarks>
 1643:         /// </summary>
 1644:         private static XmlDocument RtrvNgfsAgcfEndpointV2SoapEnvelopeXml(int gwId, string primarySwitch, int imsService, string sessionId)
 1645:         {
 1646:             string xmlContent, imsFsdb;
 1647:             XmlDocument soapEnvelopeXml;
 1648:  
 1649:             imsFsdb = Ia.Ftn.Cl.Models.Business.Nokia.Ims.ImsFsdb(imsService, primarySwitch);
 1650:  
 1651:             xmlContent = @"
 1652:     <filter>
 1653:         <search>
 1654:             <searchby>GwId</searchby>
 1655:             <searchstring>" + gwId + @"</searchstring>
 1656:             <operation>Equals</operation>
 1657:             <caseSensitive>false</caseSensitive>
 1658:         </search>
 1659:     </filter>
 1660: ";
 1661:  
 1662:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-agcfendpoint-v2", xmlContent, sessionId, "", primarySwitch, imsFsdb);
 1663:  
 1664:             return soapEnvelopeXml;
 1665:         }
 1666:  
 1667:         ////////////////////////////////////////////////////////////////////////////
 1668:  
 1669:         /// <summary>
 1670:         ///
 1671:         /// <remarks>
 1672:         ///   <PlexViewRequest Command="dlt-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1946199540" MaxRows="-1">
 1673:         ///   <PrividUser>priv_96522239100</PrividUser>
 1674:         ///   </PlexViewRequest>
 1675:         /// </remarks>
 1676:         /// </summary>
 1677:         private static XmlDocument DltNgfsAgcfEndpointV2SoapEnvelopeXml(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1678:         {
 1679:             string prividUser;
 1680:             XmlDocument soapEnvelopeXml;
 1681:             Dictionary<string, string> param;
 1682:  
 1683:             prividUser = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PridUser(service);
 1684:  
 1685:             param = new Dictionary<string, string>();
 1686:  
 1687:             param.Add("PrividUser", prividUser);
 1688:  
 1689:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfendpoint-v2", param, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1690:  
 1691:             return soapEnvelopeXml;
 1692:         }
 1693:  
 1694:         ////////////////////////////////////////////////////////////////////////////
 1695:  
 1696:         /// <summary>
 1697:         ///
 1698:         /// <remarks>
 1699:         ///   <PlexViewRequest Command="dlt-ngfs-agcfendpoint-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1946199540" MaxRows="-1">
 1700:         ///   <PrividUser>priv_96522239100</PrividUser>
 1701:         ///   </PlexViewRequest>
 1702:         /// </remarks>
 1703:         /// </summary>
 1704:         private static XmlDocument DltNgfsAgcfEndpointV2SoapEnvelopeXml(string service, string primarySwitch, string fsdb, string sessionId)
 1705:         {
 1706:             string prividUser;
 1707:             XmlDocument soapEnvelopeXml;
 1708:             Dictionary<string, string> param;
 1709:  
 1710:             prividUser = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PridUser(service);
 1711:  
 1712:             param = new Dictionary<string, string>();
 1713:  
 1714:             param.Add("PrividUser", prividUser);
 1715:  
 1716:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-agcfendpoint-v2", param, sessionId, "", primarySwitch, fsdb);
 1717:  
 1718:             return soapEnvelopeXml;
 1719:         }
 1720:  
 1721:         /*
 1722:         ////////////////////////////////////////////////////////////////////////////
 1723:         ////////////////////////////////////////////////////////////////////////////
 1724: 
 1725:         /// <summary>
 1726:         ///
 1727:         /// <remarks>
 1728:         /// </remarks>
 1729:         /// </summary>
 1730:         private static XmlDocument EntNgfsSubPartyV2SoapEnvelopeXml(string service, Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1731:         {
 1732:             // Not used. Subparty is created and deleted with subscriber
 1733: 
 1734:             int applicationServerId, serviceProfileNumber;
 1735:             string xmlContent, partyId, primaryPuid, alternateFsdbFqdn, assocOtasRealm, alternateOtasRealm;
 1736:             XmlDocument soapEnvelopeXml;
 1737: 
 1738:             partyId = Ia.Ftn.Cl.Model.Business.NumberFormatConverter.PartyId(service);
 1739:             primaryPuid = Ia.Ftn.Cl.Model.Business.NumberFormatConverter.PrimaryPuid(service);
 1740: 
 1741:             Ia.Ftn.Cl.Model.Business.Nokia.Ims.AssocAndAlternateOtasRealm(nddOnt.PrimarySwitch, nddOnt.ImsFsdb, out applicationServerId, out assocOtasRealm, out alternateOtasRealm);
 1742: 
 1743:             serviceProfileNumber = Ia.Ftn.Cl.Model.Business.Nokia.Ims.ServiceProfileNumber(applicationServerId);
 1744: 
 1745:             alternateFsdbFqdn = Ia.Ftn.Cl.Model.Business.Nokia.Ims.AlternateFsdbFqdn(nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1746: 
 1747:             xmlContent = @"
 1748:     <PartyId>" + partyId + @"</PartyId>
 1749:     <PrimaryPUID>" + primaryPuid + @"</PrimaryPUID>
 1750:     <DisplayName>" + service + @"</DisplayName>
 1751:     <AssocOtasRealm>" + assocOtasRealm + @"</AssocOtasRealm>
 1752:     <AlternateFsdbFqdn>" + alternateFsdbFqdn + @"</AlternateFsdbFqdn>
 1753:     <Category>RESIDENTIALSUBSCRIBER_R2</Category>
 1754:     <PrimaryPUIDDomainRequired>false</PrimaryPUIDDomainRequired>
 1755:     <PrimaryPUIDCPEProfileNumber>0</PrimaryPUIDCPEProfileNumber>
 1756:     <PrimaryPUIDFlashable>false</PrimaryPUIDFlashable>
 1757:     <NetworkProfileName></NetworkProfileName>
 1758:     <NetworkProfileVersion>0</NetworkProfileVersion>
 1759:     <ServiceProfileName></ServiceProfileName>
 1760:     <ServiceProfileVersion>0</ServiceProfileVersion>
 1761:     <IsReducedServiceProfile>false</IsReducedServiceProfile>
 1762:     <CallLimit>2</CallLimit>
 1763:     <ServiceSuspension>false</ServiceSuspension>
 1764:     <OriginationSuspension>false</OriginationSuspension>
 1765:     <TerminationSuspension>false</TerminationSuspension>
 1766:     <SuspensionNotification>false</SuspensionNotification>
 1767:     <UserOrigSuspension>false</UserOrigSuspension>
 1768:     <UserTermSuspension>false</UserTermSuspension>
 1769:     <AssocWpifRealm></AssocWpifRealm>
 1770:     <IddPrefix></IddPrefix>
 1771:     <SharedHssData>false</SharedHssData>
 1772:     <Pin></Pin>
 1773:     <MsnCapability>false</MsnCapability>
 1774:     <VideoProhibit>false</VideoProhibit>
 1775:     <MaxFwdHops>10</MaxFwdHops>
 1776:     <CsdFlavor>TAS_CSD_NONE</CsdFlavor>
 1777:     <CsdDynamic>false</CsdDynamic>
 1778:     <SipErrorTableId>0</SipErrorTableId>
 1779:     <TreatmentTableId>0</TreatmentTableId>
 1780:     <Locale></Locale>
 1781:     <CliPrefixList></CliPrefixList>
 1782:     <IsGroupCPE>false</IsGroupCPE>
 1783:     <Receive181Mode>TAS_181_NONE</Receive181Mode>
 1784:     <CcNdcLength>0</CcNdcLength>
 1785:     <MaxActiveCalls>0</MaxActiveCalls>
 1786:     <CallingPartyCategory>CPC_ORDINARY</CallingPartyCategory>
 1787:     <PublicUID1></PublicUID1>
 1788:     <PublicUID2></PublicUID2>
 1789:     <PublicUID3></PublicUID3>
 1790:     <PublicUID4></PublicUID4>
 1791:     <PublicUID5></PublicUID5>
 1792:     <PublicUID6></PublicUID6>
 1793:     <PublicUID7></PublicUID7>
 1794:     <PublicUID8></PublicUID8>
 1795:     <PublicUID9></PublicUID9>
 1796:     <PublicUID1DomainRequired>false</PublicUID1DomainRequired>
 1797:     <PublicUID2DomainRequired>false</PublicUID2DomainRequired>
 1798:     <PublicUID3DomainRequired>false</PublicUID3DomainRequired>
 1799:     <PublicUID4DomainRequired>false</PublicUID4DomainRequired>
 1800:     <PublicUID5DomainRequired>false</PublicUID5DomainRequired>
 1801:     <PublicUID6DomainRequired>false</PublicUID6DomainRequired>
 1802:     <PublicUID7DomainRequired>false</PublicUID7DomainRequired>
 1803:     <PublicUID8DomainRequired>false</PublicUID8DomainRequired>
 1804:     <PublicUID9DomainRequired>false</PublicUID9DomainRequired>
 1805:     <WildCardPUIDStr></WildCardPUIDStr>
 1806:     <AllowCustomAnnouncement>false</AllowCustomAnnouncement>
 1807:     <PtySpareLong1>0</PtySpareLong1>
 1808:     <PtySpareString></PtySpareString>
 1809:     <PtySpareString2></PtySpareString2>
 1810:     <PtySpareShort1>0</PtySpareShort1>
 1811:     <PtySpareShort2>0</PtySpareShort2>
 1812:     <PtySpareBool1>false</PtySpareBool1>
 1813:     <PtySpareBool2>false</PtySpareBool2>
 1814:     <PtySpareBool3>false</PtySpareBool3>
 1815:     <PtySpareBool4>false</PtySpareBool4>
 1816:     <PtySpareBool5>false</PtySpareBool5>
 1817:     <PtySpareBool6>false</PtySpareBool6>
 1818:     <PtySpareBool7>false</PtySpareBool7>
 1819:     <PtySpareBool8>false</PtySpareBool8>
 1820:     <TerminatingTableId>0</TerminatingTableId>
 1821:     <AllowNonSipTelUri>false</AllowNonSipTelUri>
 1822:     <LocationType>None</LocationType>
 1823:     <RncID></RncID>
 1824:     <LteMcc></LteMcc>
 1825:     <LteMnc></LteMnc>
 1826:     <LteTac></LteTac>
 1827:     <MarketSID></MarketSID>
 1828:     <SwitchNumber></SwitchNumber>
 1829:     <CallsToWebUserProhibited>false</CallsToWebUserProhibited>
 1830:     <IMSI></IMSI>
 1831:     <IMSNotSupported>false</IMSNotSupported>
 1832:     <ValidateCellID>false</ValidateCellID>
 1833:     <OperatorID>0</OperatorID>
 1834:     <HomeMTA>0</HomeMTA>
 1835:     <ForwardDenyNumbers>false</ForwardDenyNumbers>
 1836:     <PlayAnnoFailNotForward>false</PlayAnnoFailNotForward>
 1837:     <MrfPoolID>0</MrfPoolID>
 1838:     <Custom120x>false</Custom120x>
 1839: ";
 1840: 
 1841:             soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-subparty-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1842: 
 1843:             return soapEnvelopeXml;
 1844:         }
 1845:         */
 1846:  
 1847:         ////////////////////////////////////////////////////////////////////////////
 1848:  
 1849:         /// <summary>
 1850:         ///
 1851:         /// <remarks>
 1852:         ///   <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1642424089" MaxRows="-1">
 1853:         ///       <SubParty>
 1854:         ///               <PartyId>+96522239100</PartyId>
 1855:         ///     </SubParty>
 1856:         ///   </PlexViewRequest>
 1857:         /// </remarks>
 1858:         /// </summary>
 1859:         private static XmlDocument RtrvNgfsSubPartyV2SoapEnvelopeXml(string partyId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1860:         {
 1861:             string xmlContent;
 1862:             XmlDocument soapEnvelopeXml;
 1863:  
 1864:             xmlContent = @"
 1865:     <Aid>" + partyId + @"</Aid>
 1866: ";
 1867:  
 1868:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subparty-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1869:  
 1870:             return soapEnvelopeXml;
 1871:         }
 1872:  
 1873:         ////////////////////////////////////////////////////////////////////////////
 1874:  
 1875:         /// <summary>
 1876:         ///
 1877:         /// <remarks>
 1878:         ///   <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" Fsdb="fsdb0" RequestId="" SessionId="ngnAPI:1642424089" MaxRows="-1">
 1879:         ///       <SubParty>
 1880:         ///               <PartyId>+96522239100</PartyId>
 1881:         ///     </SubParty>
 1882:         ///   </PlexViewRequest>
 1883:         /// </remarks>
 1884:         /// </summary>
 1885:         private static XmlDocument RtrvNgfsSubPartyV2SoapEnvelopeXml(string partyId, string primarySwitch, int imsService, string sessionId)
 1886:         {
 1887:             string xmlContent, imsFsdb;
 1888:             XmlDocument soapEnvelopeXml;
 1889:  
 1890:             imsFsdb = Ia.Ftn.Cl.Models.Business.Nokia.Ims.ImsFsdb(imsService, primarySwitch);
 1891:  
 1892:             xmlContent = @"
 1893:     <Aid>" + partyId + @"</Aid>
 1894: ";
 1895:  
 1896:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subparty-v2", xmlContent, sessionId, "", primarySwitch, imsFsdb);
 1897:  
 1898:             return soapEnvelopeXml;
 1899:         }
 1900:  
 1901:         ////////////////////////////////////////////////////////////////////////////
 1902:  
 1903:         /// <summary>
 1904:         ///
 1905:         /// <remarks>
 1906:         ///   <PlexViewRequest Command="dlt-ngfs-subparty-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
 1907:         ///     <PartyId>+96522239100</PartyId>
 1908:         ///   </PlexViewRequest>
 1909:         /// </remarks>
 1910:         /// </summary>
 1911:         private static XmlDocument DltNgfsSubPartyV2SoapEnvelopeXml(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1912:         {
 1913:             // Not used. Subparty is created and deleted with subscriber
 1914:  
 1915:             string xmlContent, partyId;
 1916:             XmlDocument soapEnvelopeXml;
 1917:  
 1918:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 1919:  
 1920:             xmlContent = @"
 1921:     <Aid>" + partyId + @"</Aid>
 1922: ";
 1923:  
 1924:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-subparty-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1925:  
 1926:             return soapEnvelopeXml;
 1927:         }
 1928:  
 1929:         ////////////////////////////////////////////////////////////////////////////
 1930:         ////////////////////////////////////////////////////////////////////////////
 1931:  
 1932:         /// <summary>
 1933:         ///
 1934:         /// </summary>
 1935:         private static XmlDocument EntNgfsSubscriberV2SoapEnvelopeXml(string service, bool isSip, int gwId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 1936:         {
 1937:             bool sendTelURI;
 1938:             int applicationServerId, prsetNumber, serviceProfileNumber, primaryPUIDCPEProfileNumber;
 1939:             string xmlContent, partyId, primaryPuid, domainName, alternateFsdbFqdn, assocOtasRealm, alternateOtasRealm;
 1940:             XmlDocument soapEnvelopeXml;
 1941:  
 1942:             domainName = "ims.moc1.kw";
 1943:             sendTelURI = true;
 1944:  
 1945:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 1946:             primaryPuid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PrimaryPuid(service);
 1947:  
 1948:             if (isSip)
 1949:             {
 1950:                 prsetNumber = 0;
 1951:                 primaryPUIDCPEProfileNumber = Ia.Ftn.Cl.Models.Business.Nokia.Ims.PrimaryPUIDCPEProfileNumberForSip;
 1952:             }
 1953:             else // if H.248
 1954:             {
 1955:                 prsetNumber = gwId;
 1956:                 primaryPUIDCPEProfileNumber = Ia.Ftn.Cl.Models.Business.Nokia.Ims.PrimaryPUIDCPEProfileNumberForH248;
 1957:             }
 1958:  
 1959:             Ia.Ftn.Cl.Models.Business.Nokia.Ims.AssocAndAlternateOtasRealm(nddOnt.PrimarySwitch, nddOnt.ImsFsdb, out applicationServerId, out assocOtasRealm, out alternateOtasRealm);
 1960:  
 1961:             serviceProfileNumber = Ia.Ftn.Cl.Models.Business.Nokia.Ims.ServiceProfileNumber(applicationServerId);
 1962:  
 1963:             alternateFsdbFqdn = Ia.Ftn.Cl.Models.Business.Nokia.Ims.AlternateFsdbFqdn(nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1964:  
 1965:             /*
 1966: <SubParty>
 1967:     <PartyId>" + partyId + @"</PartyId>
 1968:     <PrimaryPUID>" + primaryPuid + @"</PrimaryPUID>
 1969:     <AssocOtasRealm>" + assocOtasRealm + @"</AssocOtasRealm>
 1970:     <Category>RESIDENTIALSUBSCRIBER_R2</Category>
 1971: </SubParty>
 1972:             */
 1973:  
 1974:             xmlContent = @"    
 1975:     <SubParty>
 1976:         <PartyId>" + partyId + @"</PartyId>
 1977:         <PrimaryPUID>" + primaryPuid + @"</PrimaryPUID>
 1978:         <DisplayName>" + service + @"</DisplayName>
 1979:         <AssocOtasRealm>" + assocOtasRealm + @"</AssocOtasRealm>
 1980:         <AlternateFsdbFqdn>" + alternateFsdbFqdn + @"</AlternateFsdbFqdn>
 1981:         <PrimaryPUIDCPEProfileNumber>" + primaryPUIDCPEProfileNumber + @"</PrimaryPUIDCPEProfileNumber>
 1982:         <Category>RESIDENTIALSUBSCRIBER_R2</Category>
 1983:         <CallLimit>3</CallLimit>
 1984:         <MaxFwdHops>5</MaxFwdHops>
 1985:         <MaxActiveCalls>3</MaxActiveCalls>
 1986:         <CliPrefixList>965</CliPrefixList>
 1987:     </SubParty>
 1988:     <AlternateOtasRealm>" + alternateOtasRealm + @"</AlternateOtasRealm>"
 1989:                                               + InternationalCallingXml(service, false)
 1990:                                               + DialingPlanXml(service)
 1991:                                               + HSSPrivateIdXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelURI)
 1992:                                               + GeoRedundancyDataXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelURI)
 1993:                                               ;
 1994:  
 1995:             soapEnvelopeXml = SoapEnvelopeXml("ent-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 1996:  
 1997:             return soapEnvelopeXml;
 1998:         }
 1999:  
 2000:         ////////////////////////////////////////////////////////////////////////////
 2001:         ////////////////////////////////////////////////////////////////////////////
 2002:  
 2003:         /// <summary>
 2004:         ///
 2005:         /// <remarks>
 2006:         /// </remarks>
 2007:         /// </summary>
 2008:         private static XmlDocument EdNgfsSubscriberV2SoapEnvelopeXml(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId, string xml)
 2009:         {
 2010:             string partyId, xmlContent;
 2011:             XmlDocument soapEnvelopeXml;
 2012:  
 2013:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 2014:  
 2015:             xmlContent = @"
 2016:     <SubParty>
 2017:         <PartyId>" + partyId + @"</PartyId>
 2018:     </SubParty>
 2019: "
 2020:                                               + xml
 2021:                                               ;
 2022:  
 2023:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 2024:  
 2025:             return soapEnvelopeXml;
 2026:         }
 2027:  
 2028:         ////////////////////////////////////////////////////////////////////////////
 2029:  
 2030:         /// <summary>
 2031:         ///
 2032:         /// <remarks>
 2033:         /// </remarks>
 2034:         /// </summary>
 2035:         private static XmlDocument EdNgfsSubscriberV2_H248ToSipSoapEnvelopeXml(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 2036:         {
 2037:             bool sendTelUri;
 2038:             int applicationServerId, prsetNumber, serviceProfileNumber, primaryPUIDCPEProfileNumber;
 2039:             string xmlContent, partyId, domainName, assocOtasRealm, alternateOtasRealm;
 2040:             XmlDocument soapEnvelopeXml;
 2041:  
 2042:             domainName = "ims.moc1.kw";
 2043:             sendTelUri = true;
 2044:  
 2045:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 2046:  
 2047:             prsetNumber = 0;
 2048:             primaryPUIDCPEProfileNumber = Ia.Ftn.Cl.Models.Business.Nokia.Ims.PrimaryPUIDCPEProfileNumberForSip;
 2049:  
 2050:             Ia.Ftn.Cl.Models.Business.Nokia.Ims.AssocAndAlternateOtasRealm(nddOnt.PrimarySwitch, nddOnt.ImsFsdb, out applicationServerId, out assocOtasRealm, out alternateOtasRealm);
 2051:  
 2052:             serviceProfileNumber = Ia.Ftn.Cl.Models.Business.Nokia.Ims.ServiceProfileNumber(applicationServerId);
 2053:  
 2054:             xmlContent = @"    
 2055:     <SubParty>
 2056:         <PartyId>" + partyId + @"</PartyId>
 2057:         <PrimaryPUIDCPEProfileNumber>" + primaryPUIDCPEProfileNumber + @"</PrimaryPUIDCPEProfileNumber>
 2058:     </SubParty>"
 2059:  
 2060:                                               + HSSPrivateIdXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelUri)
 2061:                                               + GeoRedundancyDataXml(service, prsetNumber, domainName, serviceProfileNumber, sendTelUri)
 2062:                                               ;
 2063:  
 2064:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 2065:  
 2066:             return soapEnvelopeXml;
 2067:         }
 2068:  
 2069:         ////////////////////////////////////////////////////////////////////////////
 2070:  
 2071:         /// <summary>
 2072:         ///
 2073:         /// <remarks>
 2074:         /// </remarks>
 2075:         /// </summary>
 2076:         private static XmlDocument EdNgfsSubscriberV2WithinSubPartySoapEnvelopeXml(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId, string xml)
 2077:         {
 2078:             string partyId, xmlContent;
 2079:             XmlDocument soapEnvelopeXml;
 2080:  
 2081:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 2082:  
 2083:             xmlContent = @"
 2084:     <SubParty>
 2085:         <PartyId>" + partyId + @"</PartyId>"
 2086:                    + xml + @"
 2087:     </SubParty>";
 2088:  
 2089:             soapEnvelopeXml = SoapEnvelopeXml("ed-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 2090:  
 2091:             return soapEnvelopeXml;
 2092:         }
 2093:  
 2094:         ////////////////////////////////////////////////////////////////////////////
 2095:         ////////////////////////////////////////////////////////////////////////////
 2096:  
 2097:         /// <summary>
 2098:         ///
 2099:         /// <remarks>
 2100:         /// <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:148964391" MaxRows="-1">
 2101:         ///  <aid>+96522239501</aid>
 2102:         /// </PlexViewRequest>
 2103:         /// </remarks>
 2104:         /// </summary>
 2105:         private static XmlDocument RtrvNgfsSubscriberV2SoapEnvelopeXml(string partyId, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 2106:         {
 2107:             string xmlContent;
 2108:             XmlDocument soapEnvelopeXml;
 2109:  
 2110:             xmlContent = @"
 2111:     <SubParty>
 2112:         <PartyId>" + partyId + @"</PartyId>
 2113:     </SubParty>
 2114: ";
 2115:  
 2116:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 2117:  
 2118:             return soapEnvelopeXml;
 2119:         }
 2120:  
 2121:         ////////////////////////////////////////////////////////////////////////////
 2122:  
 2123:         /// <summary>
 2124:         ///
 2125:         /// <remarks>
 2126:         /// <PlexViewRequest Command="rtrv-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:148964391" MaxRows="-1">
 2127:         ///  <aid>+96522239501</aid>
 2128:         /// </PlexViewRequest>
 2129:         /// </remarks>
 2130:         /// </summary>
 2131:         private static XmlDocument RtrvNgfsSubscriberV2SoapEnvelopeXml(string partyId, string primarySwitch, int imsService, string sessionId)
 2132:         {
 2133:             string xmlContent, imsFsdb;
 2134:             XmlDocument soapEnvelopeXml;
 2135:  
 2136:             imsFsdb = Ia.Ftn.Cl.Models.Business.Nokia.Ims.ImsFsdb(imsService, primarySwitch);
 2137:  
 2138:             xmlContent = @"
 2139:     <SubParty>
 2140:         <PartyId>" + partyId + @"</PartyId>
 2141:     </SubParty>
 2142: ";
 2143:  
 2144:             soapEnvelopeXml = SoapEnvelopeXml("rtrv-ngfs-subscriber-v2", xmlContent, sessionId, "", primarySwitch, imsFsdb);
 2145:  
 2146:             return soapEnvelopeXml;
 2147:         }
 2148:  
 2149:         ////////////////////////////////////////////////////////////////////////////
 2150:  
 2151:         /// <summary>
 2152:         ///
 2153:         /// <remarks>
 2154:         ///   <PlexViewRequest Command="dlt-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
 2155:         ///   <SubParty>
 2156:         ///     <PartyId>+96522239100</PartyId>
 2157:         ///    </SubParty>
 2158:         ///   </PlexViewRequest>
 2159:         /// </remarks>
 2160:         /// </summary>
 2161:         private static XmlDocument DltNgfsSubscriberV2SoapEnvelopeXml(string service, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string sessionId)
 2162:         {
 2163:             string partyId, xmlContent;
 2164:             XmlDocument soapEnvelopeXml;
 2165:  
 2166:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 2167:  
 2168:             xmlContent = @"
 2169:     <SubParty>
 2170:         <PartyId>" + partyId + @"</PartyId>
 2171:     </SubParty>
 2172: ";
 2173:  
 2174:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-subscriber-v2", xmlContent, sessionId, "", nddOnt.PrimarySwitch, nddOnt.ImsFsdb);
 2175:  
 2176:             return soapEnvelopeXml;
 2177:         }
 2178:  
 2179:         ////////////////////////////////////////////////////////////////////////////
 2180:  
 2181:         /// <summary>
 2182:         ///
 2183:         /// <remarks>
 2184:         ///   <PlexViewRequest Command="dlt-ngfs-subscriber-v2" SwitchName="TECICS01" RequestId="" SessionId="ngnAPI:1086840178" MaxRows="-1">
 2185:         ///   <SubParty>
 2186:         ///     <PartyId>+96522239100</PartyId>
 2187:         ///    </SubParty>
 2188:         ///   </PlexViewRequest>
 2189:         /// </remarks>
 2190:         /// </summary>
 2191:         private static XmlDocument DltNgfsSubscriberV2SoapEnvelopeXml(string service, string primarySwitch, string fsdb, string sessionId)
 2192:         {
 2193:             string partyId, xmlContent;
 2194:             XmlDocument soapEnvelopeXml;
 2195:  
 2196:             partyId = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PartyId(service);
 2197:  
 2198:             xmlContent = @"
 2199:     <SubParty>
 2200:         <PartyId>" + partyId + @"</PartyId>
 2201:     </SubParty>
 2202: ";
 2203:  
 2204:             soapEnvelopeXml = SoapEnvelopeXml("dlt-ngfs-subscriber-v2", xmlContent, sessionId, "", primarySwitch, fsdb);
 2205:  
 2206:             return soapEnvelopeXml;
 2207:         }
 2208:  
 2209:         ////////////////////////////////////////////////////////////////////////////
 2210:         ////////////////////////////////////////////////////////////////////////////
 2211:  
 2212:  
 2213:  
 2214:  
 2215:  
 2216:  
 2217:  
 2218:         ////////////////////////////////////////////////////////////////////////////
 2219:         ////////////////////////////////////////////////////////////////////////////
 2220:  
 2221:         /// <summary>
 2222:         /// DialingPlan XML
 2223:         /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
 2224:         /// </summary>
 2225:         private static string DialingPlanXml(string service)
 2226:         {
 2227:             string publicUid, xml;
 2228:  
 2229:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2230:  
 2231:             xml = @"
 2232:     <DialingPlan>
 2233:     <PublicUID>" + publicUid + @"</PublicUID>
 2234:     <Assigned>true</Assigned>
 2235:     <PerPuid>false</PerPuid>
 2236:     <PrefixandFeatureCode>1000</PrefixandFeatureCode>
 2237:     <E164NormAndCodeConv>1001</E164NormAndCodeConv>
 2238:         <CallBarringLocal>0</CallBarringLocal>
 2239:         <ESRN1></ESRN1>
 2240:         <ESRN2></ESRN2>
 2241:         <ESRN3></ESRN3>
 2242:         <ESRN4></ESRN4>
 2243:         <ESRN5></ESRN5>
 2244:         <PrivateDialingPlan>0</PrivateDialingPlan>
 2245:     </DialingPlan>
 2246: ";
 2247:             return xml;
 2248:         }
 2249:  
 2250:         ////////////////////////////////////////////////////////////////////////////
 2251:  
 2252:         /// <summary>
 2253:         /// SetTZPath XML
 2254:         /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
 2255:         /// </summary>
 2256:         private static string SetTZPathXml(string publicUid)
 2257:         {
 2258:             string xml;
 2259:  
 2260:             xml = @"
 2261:     <SetTZPath>
 2262:         <PublicUID>" + publicUid + @"</PublicUID>
 2263:         <Assigned>true</Assigned>
 2264:         <PerPuid>false</PerPuid>
 2265:         <TZPath>Asia/Kuwait</TZPath>
 2266:     </SetTZPath>
 2267: ";
 2268:             return xml;
 2269:         }
 2270:  
 2271:         ////////////////////////////////////////////////////////////////////////////
 2272:  
 2273:         /// <summary>
 2274:         /// HSSPrivateId XML
 2275:         /// <param name="service">22239100</param>
 2276:         /// <param name="prsetNumber">2101</param>
 2277:         /// <param name="domainName">ims.moc1.kw</param>
 2278:         /// </summary>
 2279:         private static string HSSPrivateIdXml(string service, int prsetNumber, string domainName, int serviceProfileNumber, bool sendTelURI)
 2280:         {
 2281:             string xml, pridUser, puid, sendTelURIString;
 2282:  
 2283:             pridUser = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PridUser(service);
 2284:             puid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.Puid(service);
 2285:  
 2286:             sendTelURIString = Convert.ToString(sendTelURI).ToLower();
 2287:  
 2288:             // <PridDomainId>0</PridDomainId>
 2289:  
 2290:             xml = @"
 2291:     <HSSPrivateId>
 2292:         <PridDomainName>" + domainName + @"</PridDomainName>
 2293:         <PridUser>" + pridUser + @"</PridUser>
 2294:         <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
 2295:         <PrivPassword>1234</PrivPassword>
 2296:         <ServerCapNumber>0</ServerCapNumber>
 2297:         <ProtectionGroupNumber>0</ProtectionGroupNumber>
 2298:         <ChargeInfoNum>0</ChargeInfoNum>
 2299:         <MediaProfileId>0</MediaProfileId>
 2300:         <PuidUserList>
 2301:             <HSSPublicId>
 2302:                 <PuidDomainName>" + domainName + @"</PuidDomainName>
 2303:                 <PridDomainName>" + domainName + @"</PridDomainName>
 2304:                 <PrivateId>" + pridUser + @"</PrivateId>
 2305:                 <Puid>" + puid + @"</Puid>
 2306:                 <IsWildcardPuid>false</IsWildcardPuid>
 2307:                 <Barring>false</Barring>
 2308:                 <ImplRegSet>1</ImplRegSet>
 2309:                 <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
 2310:                 <Authorized>true</Authorized>
 2311:                 <SendTelURI>" + sendTelURIString + @"</SendTelURI>
 2312:             </HSSPublicId>
 2313:         </PuidUserList>
 2314:     </HSSPrivateId>
 2315: ";
 2316:             return xml;
 2317:         }
 2318:  
 2319:         ////////////////////////////////////////////////////////////////////////////
 2320:  
 2321:         /// <summary>
 2322:         /// GeoRedundancyData XML
 2323:         /// <param name="service">22239100</param>
 2324:         /// <param name="prsetNumber">2101</param>
 2325:         /// <param name="domainName">ims.moc1.kw</param>
 2326:         /// </summary>
 2327:         private static string GeoRedundancyDataXml(string service, int prsetNumber, string domainName, int serviceProfileNumber, bool sendTelURI)
 2328:         {
 2329:             string xml, pridUser, puid, sendTelURIString;
 2330:  
 2331:             pridUser = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PridUser(service);
 2332:             puid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.Puid(service);
 2333:  
 2334:             sendTelURIString = Convert.ToString(sendTelURI).ToLower();
 2335:  
 2336:             xml = @"
 2337:     <GeoRedundancyData>
 2338:         <HSSPrivateId>
 2339:             <PridDomainName>" + domainName + @"</PridDomainName>
 2340:             <PridUser>" + pridUser + @"</PridUser>
 2341:             <PrsetNumber>" + prsetNumber + @"</PrsetNumber>
 2342:             <PrivPassword>1234</PrivPassword>
 2343:             <ServerCapNumber>0</ServerCapNumber>
 2344:             <ProtectionGroupNumber>0</ProtectionGroupNumber>
 2345:             <ChargeInfoNum>0</ChargeInfoNum>
 2346:             <MediaProfileId>0</MediaProfileId>
 2347:             <PuidUserList>
 2348:                 <HSSPublicId>
 2349:                     <PuidDomainName>" + domainName + @"</PuidDomainName>
 2350:                     <PridDomainName>" + domainName + @"</PridDomainName>
 2351:                     <PrivateId>" + pridUser + @"</PrivateId>
 2352:                     <Puid>" + puid + @"</Puid>
 2353:                     <IsWildcardPuid>false</IsWildcardPuid>
 2354:                     <Barring>false</Barring>
 2355:                     <ImplRegSet>1</ImplRegSet>
 2356:                     <ServiceProfileNumber>" + serviceProfileNumber + @"</ServiceProfileNumber>
 2357:                     <Authorized>true</Authorized>
 2358:                     <SendTelURI>" + sendTelURIString + @"</SendTelURI>
 2359:                 </HSSPublicId>
 2360:             </PuidUserList>
 2361:         </HSSPrivateId>
 2362:     </GeoRedundancyData>
 2363: ";
 2364:             return xml;
 2365:         }
 2366:  
 2367:         ////////////////////////////////////////////////////////////////////////////
 2368:  
 2369:         /// <summary>
 2370:         /// OneDigitSpeedDial XML
 2371:         /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
 2372:         /// </summary>
 2373:         private static string OneDigitSpeedDialXml(string publicUid)
 2374:         {
 2375:             string xml;
 2376:  
 2377:             xml = @"
 2378:     <OneDigitSpeedDial>
 2379:         <PublicUID>" + publicUid + @"</PublicUID>
 2380:         <Assigned>true</Assigned>
 2381:         <PerPuid>false</PerPuid>
 2382:         <DialCodesEntries>2^^^^^^^</DialCodesEntries>
 2383:         <DNEntries>22334455^^^^^^^</DNEntries>
 2384:     </OneDigitSpeedDial>
 2385: ";
 2386:             return xml;
 2387:         }
 2388:  
 2389:         ////////////////////////////////////////////////////////////////////////////
 2390:  
 2391:         /// <summary>
 2392:         /// CallingLineId XML
 2393:         /// <param name="service">22239100</param>
 2394:         /// <param name="serviceAssigned">true</param>
 2395:         /// </summary>
 2396:         private static string CallingLineIdXml(string service, bool serviceAssigned)
 2397:         {
 2398:             string publicUid, xml, value;
 2399:  
 2400:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2401:  
 2402:             value = Convert.ToString(serviceAssigned).ToLower();
 2403:  
 2404:             xml = @"
 2405:     <CallingLineId>
 2406:         <PublicUID>" + publicUid + @"</PublicUID>
 2407:         <CallingLineIdPresentation>" + value + @"</CallingLineIdPresentation>
 2408:         <ConnectedLinePresentation>" + value + @"</ConnectedLinePresentation>
 2409:         <Assigned>true</Assigned>
 2410:         <PerPuid>false</PerPuid>
 2411:         <CallingLineIdRestriction>PERM_PUBLIC</CallingLineIdRestriction>
 2412:         <CLIREditAllowed>false</CLIREditAllowed>
 2413:         <CallingNamePresentation>false</CallingNamePresentation>
 2414:         <RestrictionOverride>false</RestrictionOverride>
 2415:         <ConnectedLineRestriction>false</ConnectedLineRestriction>
 2416:         <ConnectedLineRestrictionOverride>false</ConnectedLineRestrictionOverride>
 2417:         <CallingNumScreen>0</CallingNumScreen>
 2418:         <ConnectedNumScreen>0</ConnectedNumScreen>
 2419:         <PDPExtensionDisplay>false</PDPExtensionDisplay>
 2420:         <COLREditAllowed>false</COLREditAllowed>
 2421:         <OrigLineIdRestrictionLevel>NONE</OrigLineIdRestrictionLevel>
 2422:         <OIPEditAllowed>false</OIPEditAllowed>
 2423:         <BlockPerCallOverride>false</BlockPerCallOverride>
 2424:         <SuppressCLIPonCallWaiting>false</SuppressCLIPonCallWaiting>
 2425:         <QueCalNameSer>OMITTED</QueCalNameSer>
 2426:         <Typ2CanSer>false</Typ2CanSer>
 2427:         <CalNameSerUrl>0</CalNameSerUrl>
 2428:         <CompanyNameQuery>false</CompanyNameQuery>
 2429:         <OrigCallingNameQuery>false</OrigCallingNameQuery>
 2430:     </CallingLineId>
 2431: ";
 2432:             return xml;
 2433:         }
 2434:  
 2435:         ////////////////////////////////////////////////////////////////////////////
 2436:  
 2437:         /// <summary>
 2438:         /// CallForwardingVari XML
 2439:         /// <param name="service">22239100</param>
 2440:         /// <param name="serviceAssigned">true</param>
 2441:         /// </summary>
 2442:         private static string CallForwardingVariXml(string service, bool serviceAssigned)
 2443:         {
 2444:             string publicUid, xml, value;
 2445:  
 2446:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2447:  
 2448:             value = Convert.ToString(serviceAssigned).ToLower();
 2449:  
 2450:             xml = @"
 2451:     <CallForwardingVari>
 2452:         <PublicUID>" + publicUid + @"</PublicUID>
 2453:         <Assigned>" + value + @"</Assigned>
 2454:         <PerPuid>false</PerPuid>
 2455:         <ForwardToDN></ForwardToDN>
 2456:         <PingRing>false</PingRing>
 2457:         <ForwardToType>FORWARD_TO_DN</ForwardToType>
 2458:         <EditPermission>EDIT_FULL</EditPermission>
 2459:         <ForwardVoiceCalls>true</ForwardVoiceCalls>
 2460:         <ForwardDataCalls>true</ForwardDataCalls>
 2461:         <ReceiveNotify>false</ReceiveNotify>
 2462:         <PlayAnnouncement>false</PlayAnnouncement>
 2463:         <PinRequired>false</PinRequired>
 2464:         <Send181Mode>TAS_181_NONE</Send181Mode>
 2465:         <RestrictIdForward>false</RestrictIdForward>
 2466:         <RestrictIdBackward>false</RestrictIdBackward>
 2467:         <DataForwardToType>USE_VOICE</DataForwardToType>
 2468:         <DataForwardToDN></DataForwardToDN>
 2469:         <Activated>false</Activated>
 2470:     </CallForwardingVari>
 2471: ";
 2472:             return xml;
 2473:         }
 2474:  
 2475:         ////////////////////////////////////////////////////////////////////////////
 2476:  
 2477:         /// <summary>
 2478:         /// CallWaiting XML
 2479:         /// <param name="service">22239100</param>
 2480:         /// <param name="serviceAssigned">true</param>
 2481:         /// </summary>
 2482:         private static string CallWaitingXml(string service, bool serviceAssigned)
 2483:         {
 2484:             string publicUid, xml, value;
 2485:  
 2486:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2487:  
 2488:             value = Convert.ToString(serviceAssigned).ToLower();
 2489:  
 2490:             xml = @"
 2491:     <CallWaiting>
 2492:         <PublicUID>" + publicUid + @"</PublicUID>
 2493:         <Assigned>true</Assigned>
 2494:         <PerPuid>false</PerPuid>
 2495:         <PlayAnnouncement>false</PlayAnnouncement>
 2496:         <IsAlternateCallWaiting>false</IsAlternateCallWaiting>
 2497:         <Programmable>false</Programmable>
 2498:         <Activated>" + value + @"</Activated>
 2499:     </CallWaiting>
 2500: ";
 2501:             return xml;
 2502:         }
 2503:  
 2504:         ////////////////////////////////////////////////////////////////////////////
 2505:  
 2506:         /// <summary>
 2507:         /// ConferenceCalling XML
 2508:         /// <param name="service">22239100</param>
 2509:         /// <param name="serviceAssigned">true</param>
 2510:         /// </summary>
 2511:         private static string ConferenceCallingXml(string service, bool serviceAssigned)
 2512:         {
 2513:             string publicUid, xml, value;
 2514:  
 2515:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2516:  
 2517:             value = Convert.ToString(serviceAssigned).ToLower();
 2518:  
 2519:             xml = @"
 2520:     <ConferenceCalling>
 2521:         <PublicUID>" + publicUid + @"</PublicUID>
 2522:         <Assigned>" + value + @"</Assigned>
 2523:         <PerPuid>false</PerPuid>
 2524:         <Transfer>false</Transfer>
 2525:         <ConfSize>3</ConfSize>
 2526:     </ConferenceCalling>
 2527: ";
 2528:             return xml;
 2529:         }
 2530:  
 2531:         ////////////////////////////////////////////////////////////////////////////
 2532:  
 2533:         /// <summary>
 2534:         /// ReminderCall XML
 2535:         /// <param name="service">22239100</param>
 2536:         /// <param name="serviceAssigned">true</param>
 2537:         /// </summary>
 2538:         private static string ReminderCallXml(string service, bool serviceAssigned)
 2539:         {
 2540:             string publicUid, xml, value;
 2541:  
 2542:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2543:  
 2544:             value = Convert.ToString(serviceAssigned).ToLower();
 2545:  
 2546:             xml = @"
 2547:     <ReminderCall>
 2548:         <PublicUID>" + publicUid + @"</PublicUID>
 2549:         <Assigned>" + value + @"</Assigned>
 2550:         <PerPuid>false</PerPuid>
 2551:         <RetryCounter>5</RetryCounter>
 2552:         <NoAnswerTimer>0</NoAnswerTimer>
 2553:     </ReminderCall>
 2554: ";
 2555:             return xml;
 2556:         }
 2557:  
 2558:         ////////////////////////////////////////////////////////////////////////////
 2559:  
 2560:         /// <summary>
 2561:         /// OneDigitSpeedDial XML
 2562:         /// <param name="service">22239100</param>
 2563:         /// <param name="serviceAssigned">true</param>
 2564:         /// </summary>
 2565:         private static string OneDigitSpeedDial(string service, bool serviceAssigned)
 2566:         {
 2567:             string publicUid, xml, value;
 2568:  
 2569:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2570:  
 2571:             value = Convert.ToString(serviceAssigned).ToLower();
 2572:  
 2573:             xml = @"
 2574:     <OneDigitSpeedDial>
 2575:         <PublicUID>" + publicUid + @"</PublicUID>
 2576:         <Assigned>" + value + @"</Assigned>
 2577:         <PerPuid>false</PerPuid>
 2578:     </OneDigitSpeedDial>
 2579: ";
 2580:             return xml;
 2581:         }
 2582:  
 2583:         ////////////////////////////////////////////////////////////////////////////
 2584:  
 2585:         /// <summary>
 2586:         /// InternationalCalling XML
 2587:         /// <param name="service">22239100</param>
 2588:         /// <param name="serviceAssigned">true</param>
 2589:         /// </summary>
 2590:         private static string InternationalCallingXml(string service, bool serviceAssigned)
 2591:         {
 2592:             string publicUid, xml, serviceAssignedString;
 2593:  
 2594:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2595:  
 2596:             serviceAssignedString = Convert.ToString(!serviceAssigned).ToLower(); // see !
 2597:  
 2598:             //         <Assigned>" + serviceAssignedString + @"</Assigned>
 2599:             // <Assigned>false</Assigned> will set the whole CallBarring tag to null
 2600:  
 2601:             xml = @"
 2602:     <CallBarring>
 2603:         <PublicUID>" + publicUid + @"</PublicUID>
 2604:         <International>" + serviceAssignedString + @"</International>
 2605:         <Assigned>" + serviceAssignedString + @"</Assigned>
 2606:         <PerPuid>false</PerPuid>
 2607:         <CallBarringAll>false</CallBarringAll>
 2608:         <Local>false</Local>
 2609:         <IntraLataToll>false</IntraLataToll>
 2610:         <InterLataToll>false</InterLataToll>
 2611:         <National>false</National>
 2612:         <PremiumServ>false</PremiumServ>
 2613:         <Emergency>false</Emergency>
 2614:         <TollFree>false</TollFree>
 2615:         <FGDDialedCarrier>false</FGDDialedCarrier>
 2616:         <FGBDialedCarrier>false</FGBDialedCarrier>
 2617:         <DirectoryAssist>false</DirectoryAssist>
 2618:         <NXXCalls>false</NXXCalls>
 2619:         <User1>false</User1>
 2620:         <User2>false</User2>
 2621:         <User3>false</User3>
 2622:         <User4>false</User4>
 2623:         <User5>false</User5>
 2624:         <User6>false</User6>
 2625:         <User7>false</User7>
 2626:         <User8>false</User8>
 2627:         <User9>false</User9>
 2628:         <User10>false</User10>
 2629:         <User11>false</User11>
 2630:         <User12>false</User12>
 2631:         <User13>false</User13>
 2632:         <NonE164>false</NonE164>
 2633:         <Mobile>false</Mobile>
 2634:         <CntrlCallBarringAll>false</CntrlCallBarringAll>
 2635:         <CntrlDirectoryAssist>false</CntrlDirectoryAssist>
 2636:         <CntrlEmergency>false</CntrlEmergency>
 2637:         <CntrlFGBDialedCarrier>false</CntrlFGBDialedCarrier>
 2638:         <CntrlFGDDialedCarrier>false</CntrlFGDDialedCarrier>
 2639:         <CntrlInterLataToll>false</CntrlInterLataToll>
 2640:         <CntrlInternational>false</CntrlInternational>
 2641:         <CntrlIntraLataToll>false</CntrlIntraLataToll>
 2642:         <CntrlLocal>false</CntrlLocal>
 2643:         <CntrlNational>false</CntrlNational>
 2644:         <CntrlNXXCalls>false</CntrlNXXCalls>
 2645:         <CntrlPremiumServ>false</CntrlPremiumServ>
 2646:         <CntrlTollFree>false</CntrlTollFree>
 2647:         <CntrlUser1>false</CntrlUser1>
 2648:         <CntrlUser2>false</CntrlUser2>
 2649:         <CntrlUser3>false</CntrlUser3>
 2650:         <CntrlUser4>false</CntrlUser4>
 2651:         <CntrlUser5>false</CntrlUser5>
 2652:         <CntrlUser6>false</CntrlUser6>
 2653:         <CntrlUser7>false</CntrlUser7>
 2654:         <CntrlUser8>false</CntrlUser8>
 2655:         <CntrlUser9>false</CntrlUser9>
 2656:         <CntrlUser10>false</CntrlUser10>
 2657:         <CntrlUser11>false</CntrlUser11>
 2658:         <CntrlUser12>false</CntrlUser12>
 2659:         <CntrlUser13>false</CntrlUser13>
 2660:         <ReceiveNotify>false</ReceiveNotify>
 2661:         <CntrlUserCallLock>false</CntrlUserCallLock>
 2662:         <LockSet>0</LockSet>
 2663:         <CntrlNonE164>false</CntrlNonE164>
 2664:         <CntrlMobile>false</CntrlMobile>
 2665:     </CallBarring>";
 2666:  
 2667:             return xml;
 2668:         }
 2669:  
 2670:         ////////////////////////////////////////////////////////////////////////////
 2671:  
 2672:         /// <summary>
 2673:         /// InternationalCallingUserControlled XML
 2674:         /// <param name="service">22239100</param>
 2675:         /// <param name="serviceAssigned">true</param>
 2676:         /// </summary>
 2677:         private static string InternationalCallingUserControlledXml(string service, bool serviceAssigned)
 2678:         {
 2679:             string publicUid, xml, value;
 2680:  
 2681:             publicUid = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.PublicUid(service);
 2682:  
 2683:             value = Convert.ToString(serviceAssigned).ToLower();
 2684:  
 2685:             xml = @"
 2686:     <OutgoingCallBarring>
 2687:         <PublicUID>" + publicUid + @"</PublicUID>
 2688:         <Assigned>" + value + @"</Assigned>
 2689:         <AdminActive>false</AdminActive>
 2690:         <AdminProgram>0</AdminProgram>
 2691:         <UserCtrl>true</UserCtrl>
 2692:         <UserActive>true</UserActive>
 2693:         <UserProgram>1</UserProgram>
 2694:         <ReceiveNotify>false</ReceiveNotify>
 2695:         <PerPuid>false</PerPuid>
 2696:     </OutgoingCallBarring>";
 2697:  
 2698:             return xml;
 2699:         }
 2700:  
 2701:         ////////////////////////////////////////////////////////////////////////////
 2702:  
 2703:         /// <summary>
 2704:         /// ServiceSuspension XML
 2705:         /// <param name="serviceSuspensionState"
 2706:         /// </summary>
 2707:         private static string ServiceSuspension(bool serviceSuspensionState)
 2708:         {
 2709:             string xml, value;
 2710:  
 2711:             value = Convert.ToString(serviceSuspensionState).ToLower();
 2712:  
 2713:             xml = @"
 2714:     <ServiceSuspension>" + value + @"</ServiceSuspension>
 2715: ";
 2716:             return xml;
 2717:         }
 2718:  
 2719:         ////////////////////////////////////////////////////////////////////////////
 2720:  
 2721:         /// <summary>
 2722:         /// PinService XML
 2723:         /// <param name="publicUid">+96522239100@ims.moc1.kw</param>
 2724:         /// </summary>
 2725:         private static string PinServiceXml(string publicUid)
 2726:         {
 2727:             string xml;
 2728:  
 2729:             xml = @"
 2730:     <PinService>
 2731:         <PublicUID>" + publicUid + @"</PublicUID>
 2732:         <Assigned>true</Assigned>
 2733:         <PerPuid>false</PerPuid>
 2734:         <Pin>0000</Pin>
 2735:         <PinFrozen>false</PinFrozen>
 2736:     </PinService>
 2737: ";
 2738:             return xml;
 2739:         }
 2740:  
 2741:         ////////////////////////////////////////////////////////////////////////////
 2742:         ////////////////////////////////////////////////////////////////////////////
 2743:  
 2744:  
 2745:  
 2746:  
 2747:  
 2748:  
 2749:  
 2750:  
 2751:  
 2752:  
 2753:         ////////////////////////////////////////////////////////////////////////////
 2754:         ////////////////////////////////////////////////////////////////////////////
 2755:  
 2756:         /// <summary>
 2757:         ///
 2758:         /// </summary>
 2759:         private static XmlDocument SoapEnvelopeXml(string command, string xmlContent, string sessionId, string requestId, string switchName, string fsdb)
 2760:         {
 2761:             string s;
 2762:             XmlDocument soapEnvelopeXml = new XmlDocument();
 2763:  
 2764:             s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
 2765: <soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
 2766:     <soap-env:Header />
 2767:     <soap-env:Body>
 2768:         <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" Fsdb=""" + fsdb + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""32"">";
 2769:  
 2770:             s += xmlContent;
 2771:  
 2772:             s += @"
 2773:         </PlexViewRequest>
 2774:     </soap-env:Body>
 2775: </soap-env:Envelope>";
 2776:  
 2777:             soapEnvelopeXml.LoadXml(s);
 2778:  
 2779:             // below: To avoid XML shorthand closing tag you can set the IsEmpty property to false for all elements not having any child nodes:
 2780:             //foreach (XmlElement el in soapEnvelopeXml.SelectNodes("descendant::*[not(node())]")) el.IsEmpty = false;
 2781:  
 2782:             return soapEnvelopeXml;
 2783:         }
 2784:  
 2785:         ////////////////////////////////////////////////////////////////////////////
 2786:  
 2787:         /// <summary>
 2788:         ///
 2789:         /// </summary>
 2790:         private static XmlDocument SoapEnvelopeXml(string command, string xmlContent, string sessionId, string requestId, string switchName)
 2791:         {
 2792:             string s;
 2793:             XmlDocument soapEnvelopeXml = new XmlDocument();
 2794:  
 2795:             s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
 2796: <soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
 2797:     <soap-env:Header />
 2798:     <soap-env:Body>
 2799:         <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""32"">";
 2800:  
 2801:             s += xmlContent;
 2802:  
 2803:             s += @"
 2804:         </PlexViewRequest>
 2805:     </soap-env:Body>
 2806: </soap-env:Envelope>";
 2807:  
 2808:             soapEnvelopeXml.LoadXml(s);
 2809:  
 2810:             // below: To avoid XML shorthand closing tag you can set the IsEmpty property to false for all elements not having any child nodes:
 2811:             //foreach (XmlElement el in soapEnvelopeXml.SelectNodes("descendant::*[not(node())]")) el.IsEmpty = false;
 2812:  
 2813:             return soapEnvelopeXml;
 2814:         }
 2815:  
 2816:         ////////////////////////////////////////////////////////////////////////////
 2817:  
 2818:         /// <summary>
 2819:         ///
 2820:         /// </summary>
 2821:         private static XmlDocument SoapEnvelopeXml(string command, Dictionary<string, string> param, string sessionId, string requestId, string switchName)
 2822:         {
 2823:             string s, name, value;
 2824:             XmlDocument soapEnvelopeXml = new XmlDocument();
 2825:  
 2826:             s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
 2827: <soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
 2828:     <soap-env:Header />
 2829:     <soap-env:Body>
 2830:         <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""-1"">";
 2831:  
 2832:             if (param != null)
 2833:             {
 2834:                 foreach (KeyValuePair<string, string> u in param)
 2835:                 {
 2836:                     name = u.Key;
 2837:                     value = u.Value;
 2838:  
 2839:                     s += @"            <" + name + @">" + value + @"</" + name + @">";
 2840:                 }
 2841:             }
 2842:  
 2843:             s += @"
 2844:         </PlexViewRequest>
 2845:     </soap-env:Body>
 2846: </soap-env:Envelope>";
 2847:  
 2848:             soapEnvelopeXml.LoadXml(s);
 2849:  
 2850:             return soapEnvelopeXml;
 2851:         }
 2852:  
 2853:         ////////////////////////////////////////////////////////////////////////////
 2854:  
 2855:         /// <summary>
 2856:         ///
 2857:         /// </summary>
 2858:         private static XmlDocument SoapEnvelopeXml(string command, Dictionary<string, string> param, string sessionId, string requestId, string switchName, string fsdb)
 2859:         {
 2860:             string s, name, value;
 2861:             XmlDocument soapEnvelopeXml = new XmlDocument();
 2862:  
 2863:             s = @"<?xml version=""1.0"" encoding=""UTF-8""?>
 2864: <soap-env:Envelope xmlns:soap-env=""http://schemas.xmlsoap.org/soap/envelope/"">
 2865:     <soap-env:Header />
 2866:     <soap-env:Body>
 2867:         <PlexViewRequest Command=""" + command + @""" SwitchName=""" + switchName + @""" Fsdb=""" + fsdb + @""" RequestId=""" + requestId + @""" SessionId=""" + sessionId + @""" MaxRows=""-1"">";
 2868:  
 2869:             if (param != null)
 2870:             {
 2871:                 foreach (KeyValuePair<string, string> u in param)
 2872:                 {
 2873:                     name = u.Key;
 2874:                     value = u.Value;
 2875:  
 2876:                     s += @"            <" + name + @">" + value + @"</" + name + @">";
 2877:                 }
 2878:             }
 2879:  
 2880:             s += @"
 2881:         </PlexViewRequest>
 2882:     </soap-env:Body>
 2883: </soap-env:Envelope>";
 2884:  
 2885:             soapEnvelopeXml.LoadXml(s);
 2886:  
 2887:             return soapEnvelopeXml;
 2888:         }
 2889:  
 2890:         ////////////////////////////////////////////////////////////////////////////
 2891:  
 2892:         /// <summary>
 2893:         ///
 2894:         /// </summary>
 2895:         private void SendSoapRequestAndReadResponse(XmlDocument soapEnvelopeXml, out XmlDocument soapResultXmlDocument)
 2896:         {
 2897:             string url, action;
 2898:             string soapResult;
 2899:             HttpWebRequest request;
 2900:  
 2901:             sessionId = string.Empty;
 2902:             soapResultXmlDocument = new XmlDocument();
 2903:  
 2904:             url = Ia.Ftn.Cl.Models.Business.Nokia.Ims.BaseAddress + "/" + Ia.Ftn.Cl.Models.Business.Nokia.Ims.ServiceUrl;
 2905:             action = "PlexViewRequest";
 2906:  
 2907:             request = CreateWebRequest(url, action);
 2908:  
 2909:             byte[] bytes;
 2910:             bytes = System.Text.Encoding.ASCII.GetBytes(soapEnvelopeXml.OuterXml);
 2911:             request.ContentType = "text/xml; encoding='utf-8'";
 2912:             request.ContentLength = bytes.Length;
 2913:             request.Method = "POST";
 2914:  
 2915:             try
 2916:             {
 2917:                 using (Stream stream = request.GetRequestStream())
 2918:                 {
 2919:                     stream.Write(bytes, 0, bytes.Length);
 2920:                     //soapEnvelopeXml.Save(stream);
 2921:                 }
 2922:  
 2923:                 using (WebResponse response = request.GetResponse())
 2924:                 {
 2925:                     using (StreamReader rd = new StreamReader(response.GetResponseStream()))
 2926:                     {
 2927:                         soapResult = rd.ReadToEnd();
 2928:  
 2929:                         soapResultXmlDocument.LoadXml(soapResult);
 2930:                     }
 2931:                 }
 2932:             }
 2933:             catch (Exception)// e)
 2934:             {
 2935:             }
 2936:         }
 2937:  
 2938:         ////////////////////////////////////////////////////////////////////////////
 2939:  
 2940:         /// <summary>
 2941:         ///
 2942:         /// </summary>
 2943:         private void ParseSoapResultXml(XmlDocument soapResultXmlDocument, out Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response response)
 2944:         {
 2945:             Dictionary<string, string> parameterDictionary;
 2946:             XmlNode xn;
 2947:  
 2948:             response = new Ia.Ftn.Cl.Models.Business.Nokia.Ims.Response();
 2949:  
 2950:             parameterDictionary = new Dictionary<string, string>();
 2951:             response.ParameterDictionaryList = new List<Dictionary<string, string>>(32);
 2952:  
 2953:             if (soapResultXmlDocument.DocumentElement != null)
 2954:             {
 2955:                 xn = soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild;
 2956:  
 2957:                 commandInLower = xn.Attributes["Command"].Value.ToLower();
 2958:                 switchName = xn.Attributes["SwitchName"].Value;
 2959:                 //fsdb = (xn.Attributes["Fsdb"] != null) ? xn.Attributes["Fsdb"].Value : null;
 2960:                 requestId = xn.Attributes["RequestId"].Value;
 2961:                 sessionId = xn.Attributes["SessionId"].Value;
 2962:                 success = xn.Attributes["Status"].Value == "SUCCESS" ? true : false;
 2963:  
 2964:                 if (success)
 2965:                 {
 2966:                     if (commandInLower == "rtrv-ngfs-agcfendpoint-v2" || commandInLower == "dlt-ngfs-agcfendpoint-v2" ||
 2967:                         commandInLower == "rtrv-ngfs-agcfgatewayrecord-v2" || commandInLower == "dlt-ngfs-agcfgatewayrecord-v2" ||
 2968:                         commandInLower == "rtrv-ngfs-subparty-v2" || commandInLower == "dlt-ngfs-subparty-v2"
 2969:                         )
 2970:                     {
 2971:                         if (soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild.FirstChild != null)
 2972:                         {
 2973:                             foreach (XmlNode xn2 in soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild.ChildNodes)
 2974:                             {
 2975:                                 parameterDictionary = CollectXmlNodeChildNodesValuesIntoDictionary(xn2);
 2976:  
 2977:                                 response.ParameterDictionaryList.Add(parameterDictionary);
 2978:                             }
 2979:  
 2980:                             response.ResultCode = Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful;
 2981:                         }
 2982:                         else
 2983:                         {
 2984:                             response.ResultCode = Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.SuccessfulButNoParameters;
 2985:                         }
 2986:                     }
 2987:                     else /*if(commandInLower == "rtrv-ngfs-subscriber-v2" || commandInLower == "dlt-ngfs-subscriber-v2" )*/
 2988:                     {
 2989:                         if (soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild != null)
 2990:                         {
 2991:                             parameterDictionary = CollectXmlNodeChildNodesValuesIntoDictionary(soapResultXmlDocument.DocumentElement.ChildNodes[1].FirstChild);
 2992:  
 2993:                             response.ParameterDictionaryList.Add(parameterDictionary);
 2994:  
 2995:                             response.ResultCode = Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.Successful;
 2996:                         }
 2997:                         else
 2998:                         {
 2999:                             response.ResultCode = Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.SuccessfulButNoParameters;
 3000:                         }
 3001:                     }
 3002:  
 3003:                     // below: if command is act-user we will read the sessionId from the parameters
 3004:                     if (commandInLower == "act-user") sessionId = parameterDictionary["SessionId"].ToString();
 3005:                     // below: if command is canc-user we will null the sessionId
 3006:                     else if (commandInLower == "canc-user" && success) sessionId = string.Empty;
 3007:                 }
 3008:                 else
 3009:                 {
 3010:                     response.FailureReason = xn.Attributes["FailureReason"].Value;
 3011:                     response.FailureCode = xn.Attributes["FailureCode"].Value;
 3012:  
 3013:                     response.ResultCode = (Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode)int.Parse(response.FailureCode);
 3014:                 }
 3015:             }
 3016:             else
 3017:             {
 3018:                 response.ResultCode = Ia.Ftn.Cl.Models.Client.Nokia.Ims.ResultCode.DocumentElementIsNull;
 3019:             }
 3020:         }
 3021:  
 3022:         ////////////////////////////////////////////////////////////////////////////
 3023:  
 3024:         /// <summary>
 3025:         ///
 3026:         /// </summary>
 3027:         /// <returns></returns>
 3028:         private Dictionary<string, string> CollectXmlNodeChildNodesValuesIntoDictionary(XmlNode xn)
 3029:         {
 3030:             Dictionary<string, string> parameterDictionary;
 3031:  
 3032:             parameterDictionary = new Dictionary<string, string>();
 3033:  
 3034:             foreach (XmlElement xe in xn.ChildNodes)
 3035:             {
 3036:                 // below: if the node has children(?) we will treat it as an XDocument and add its name to a top level tag
 3037:                 if (xe.ChildNodes.Count > 1) parameterDictionary.Add(xe.Name, xe.OuterXml);
 3038:                 else parameterDictionary.Add(xe.Name, xe.InnerText);
 3039:             }
 3040:  
 3041:             return parameterDictionary;
 3042:         }
 3043:  
 3044:         ////////////////////////////////////////////////////////////////////////////
 3045:  
 3046:         /// <summary>
 3047:         /// Create a soap webrequest to [Url]
 3048:         /// </summary>
 3049:         /// <see cref="http://www.roelvanlisdonk.nl/?p=1893"/>
 3050:         /// <returns></returns>
 3051:         private HttpWebRequest CreateWebRequest(string url, string action)
 3052:         {
 3053:             HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
 3054:  
 3055:             webRequest.Headers.Add(@"SOAP:" + action);
 3056:             webRequest.ContentType = "text/xml;charset=\"utf-8\"";
 3057:             webRequest.Accept = "text/xml";
 3058:             webRequest.Method = "POST";
 3059:  
 3060:             return webRequest;
 3061:         }
 3062:  
 3063:         ////////////////////////////////////////////////////////////////////////////
 3064:         ////////////////////////////////////////////////////////////////////////////
 3065:     }
 3066:  
 3067:     ////////////////////////////////////////////////////////////////////////////
 3068:     ////////////////////////////////////////////////////////////////////////////
 3069: }