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