6. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 8/8/2017 4:09:17 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

6.1 Files compared

# Location File Last Modified
1 Purch Care Auth Compliance P3.zip\AET4.Server\AETService ESWebService.cs Thu Jan 5 15:51:00 2017 UTC
2 Purch Care Auth Compliance P3.zip\AET4.Server\AETService ESWebService.cs Tue Aug 8 14:18:08 2017 UTC

6.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 1172
Changed 2 4
Inserted 0 0
Removed 0 0

6.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

6.4 Active regular expressions

No regular expressions were active.

6.5 Comparison detail

  1   using Syst em;
  2   using Syst em.Linq;
  3   using Syst em.Text;
  4   using Syst em.IO;
  5   using Syst em.Net;
  6   using Syst em.Xml;
  7   using Syst em.Securit y.Cryptogr aphy.X509C ertificate s;
  8   using Syst em.Securit y.Policy;
  9   using AETS hared;
  10  
  11   namespace  AETService
  12   {
  13       class  ESWebServi ce
  14       {
  15           pr ivate stri ng m_post_ data = str ing.Empty;
  16  
  17           pr ivate stri ng m_url =  string.Em pty;
  18           pr ivate stri ng m_mviID  = string. Empty;
  19  
  20           pr ivate stri ng m_Estat us = strin g.Empty;
  21           pr ivate stri ng m_Edate  = string. Empty;
  22  
  23           pr ivate bool  m_WriteLo g = false;
  24           pr ivate int  m_logid =  0;
  25  
  26           pr ivate stri ng m_espay load = str ing.Empty;
  27           pr ivate stri ng m_ESUN  = string.E mpty;
  28           pr ivate stri ng m_ESPW  = string.E mpty;
  29  
  30           pr ivate stri ng m_line1  = string. Empty;
  31           pr ivate stri ng m_city  = string.E mpty;
  32           pr ivate stri ng m_state  = string. Empty;
  33           pr ivate stri ng m_zipco de = strin g.Empty;
  34  
  35  
  36           pu blic strin g Line1
  37           {
  38                get { re turn m_lin e1; }
  39                set { m_ line1 = va lue; }
  40           }
  41  
  42           pu blic strin g City
  43           {
  44                get { re turn m_cit y; }
  45                set { m_ city = val ue; }
  46           }
  47           pu blic strin g State
  48           {
  49                get { re turn m_sta te; }
  50                set { m_ state = va lue; }
  51           }
  52           pu blic strin g ZipCode
  53           {
  54                get { re turn m_zip code; }
  55                set { m_ zipcode =  value; }
  56           }
  57           pu blic int L OGID
  58           {
  59                get { re turn m_log id; }
  60                set { m_ logid = va lue; }
  61           }
  62  
  63           pu blic bool  WriteLog
  64           {
  65                get { re turn m_Wri teLog; }
  66                set { m_ WriteLog =  value; }
  67           }
  68  
  69           pu blic strin g ESUN
  70           {
  71                get { re turn m_ESU N; }
  72                set { m_ ESUN = val ue; }
  73           }
  74           pu blic strin g Payload
  75           {
  76                get { re turn m_esp ayload; }
  77                set { m_ espayload  = value; }
  78           }
  79  
  80           pu blic strin g ESPW
  81           {
  82                get { re turn m_ESP W; }
  83                set { m_ ESPW = val ue; }
  84           }
  85  
  86           pu blic strin g URL
  87           {
  88                get { re turn m_url ; }
  89                set { m_ url = valu e; }
  90           }
  91           pu blic strin g MVI_ID
  92           {
  93                get { re turn m_mvi ID; }
  94                set { m_ mviID = va lue; }
  95           }
  96           pu blic strin g Status
  97           {
  98                get { re turn m_Est atus; }
  99                set { m_ Estatus =  value; }
  100           }
  101           pu blic strin g Date
  102           {
  103                get { re turn m_Eda te; }
  104                set { m_ Edate = va lue; }
  105           }
  106           pu blic strin g GetFileD ata(string  fileName)
  107           {
  108                string R tnData = " ";
  109                try
  110                {
  111                    usin g (StreamR eader sr =  new Strea mReader(fi leName))
  112                    {
  113                         //This all ows you to  do one Re ad operati on.
  114                         RtnData =  sr.ReadToE nd();
  115                    }
  116                }
  117                catch (E xception e )
  118                {
  119                    Cons ole.WriteL ine("The p rocess fai led: {0}",  e);
  120                }
  121  
  122                return R tnData;
  123  
  124           }
  125  
  126           // / <summary >
  127           // / //////// ////////// ////////// ////////// ////////// //////////
  128           // / </summar y>
  129           // / <returns ></returns >
  130           pu blic strin g CALL_ES( )
  131           {
  132                string s RTN = stri ng.Empty;
  133                string o utXML = st ring.Empty ;
  134  
  135                bool bLo gESPostXML  = m_Write Log;
  136  
  137  
  138  
  139  
  140  
  141                //string  XMLPOST1  = "<?xml v ersion=\"1 .0\" encod ing=\"utf- 8\"?>\r\n" ;
  142                string X MLPOST2 =  "<soap:Env elope xmln s:soap=\"h ttp://sche mas.xmlsoa p.org/soap /envelope/ \" xmlns:x si=\"http: //www.w3.o rg/2001/XM LSchema-in stance\" x mlns:xsd=\ "http://ww w.w3.org/2 001/XMLSch ema\" xmln s:wsa=\"ht tp://schem as.xmlsoap .org/ws/20 04/08/addr essing\" x mlns:wsse= \"http://d ocs.oasis- open.org/w ss/2004/01 /oasis-200 401-wss-ws security-s ecext-1.0. xsd\" xmln s:wsu=\"ht tp://docs. oasis-open .org/wss/2 004/01/oas is-200401- wss-wssecu rity-utili ty-1.0.xsd \">\r\n";
  143                string X MLPOST3 =  "<soap:Hea der>\r\n";
  144                string X MLPOST4 =  "  <wsse:S ecurity so ap:mustUnd erstand=\" 1\">\r\n";
  145                string X MLPOST5 =  "     <wss e:Username Token xmln s:wsu=\"ht tp://docs. oasis-open .org/wss/2 004/01/oas is-200401- wss-wssecu rity-utili ty-1.0.xsd \" wsu:Id= \"Security Token-3e77 4eaa-9840- 4888-9e4c- e966b3bf60 92\">\r\n" ;
  146                string X MLPOST6 =  String.For mat("        <wsse:Us ername>{0} </wsse:Use rname>\r\n ", m_ESUN) ;
  147                string X MLPOST7 =  String.For mat("       <wsse:Pas sword Type =\"http:// docs.oasis -open.org/ wss/2004/0 1/oasis-20 0401-wss-u sername-to ken-profil e-1.0#Pass wordText\" >{0}</wsse :Password> \r\n", m_E SPW);
  148                string X MLPOST8 =  "    </wss e:Username Token>\r\n ";
  149                string X MLPOST9 =  "   </wsse :Security> \r\n";
  150                string X MLPOST10 =  " </soap: Header>\r\ n";
  151                string X MLPOST11 =  "  <soap: Body>\r\n" ;
  152                  string XML POST12 = "      <getEESumm aryRequest  xmlns=\"h ttp:// DNS . URL         /schemas\" >\r\n";
  153                string X MLPOST13 =  String.Fo rmat("      <key>{0}< /key>\r\n" , m_mviID) ;
  154                string X MLPOST14 =  "     <re questName> aetRequest </requestN ame>\r\n";
  155                string X MLPOST15 =  "   </get EESummaryR equest>\r\ n";
  156                string X MLPOST16 =  " </soap: Body>\r\n" ;
  157                string X MLPOST17 =  "</soap:E nvelope>\r \n";
  158  
  159                if (m_ur l.Trim().L ength == 0 )
  160                {
  161                    sRTN  = "ERR:"  + "NO URL" ;
  162                    retu rn sRTN;
  163  
  164                }
  165  
  166                m_post_d ata = /*XM LPOST1 +*/  XMLPOST2  + XMLPOST3  + XMLPOST 4 + XMLPOS T5 + XMLPO ST6 + XMLP OST7 + XML POST8 + XM LPOST9 + X MLPOST10 +  XMLPOST11  + XMLPOST 12 + XMLPO ST13 + XML POST14 + X MLPOST15 +  XMLPOST16  + XMLPOST 17;
  167  
  168                sRTN = M akeSOAPCal l(bLogESPo stXML);
  169  
  170                return s RTN;
  171           }
  172           // / <summary >
  173           // / //////// ////////// ////////// ////////// //////
  174           // / </summar y>
  175           // / <param n ame="sende r"></param >
  176           // / <param n ame="certi ficate"></ param>
  177           // / <param n ame="chain "></param>
  178           // / <param n ame="sslPo licyErrors "></param>
  179           // / <returns ></returns >
  180           pu blic stati c bool MyC ertValidat ionCb(obje ct sender,  X509Certi ficate cer tificate,  X509Chain  chain, Sys tem.Net.Se curity.Ssl PolicyErro rs sslPoli cyErrors)
  181           {
  182                if ((ssl PolicyErro rs & Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateCh ainErrors)
  183                           == Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateCh ainErrors)
  184                {
  185                    retu rn true;
  186                }
  187                else if  ((sslPolic yErrors &  System.Net .Security. SslPolicyE rrors.Remo teCertific ateNameMis match)
  188                                 ==  System.Ne t.Security .SslPolicy Errors.Rem oteCertifi cateNameMi smatch)
  189                {
  190                    Zone  z;
  191                    z =  Zone.Creat eFromUrl(( (HttpWebRe quest)send er).Reques tUri.ToStr ing());
  192                    if ( z.Security Zone == Sy stem.Secur ity.Securi tyZone.Int ranet
  193                      ||  z.Securit yZone == S ystem.Secu rity.Secur ityZone.My Computer)
  194                    {
  195                         return tru e;
  196                    }
  197                    retu rn false;
  198                }
  199                return t rue;
  200           }
  201           // / <summary >
  202           // / //////// ////////// ////////// ////////// //////
  203           // / </summar y>
  204           // / <param n ame="bLogE SPostXML"> </param>
  205           // / <returns ></returns >
  206           pr ivate stri ng MakeSOA PCall(bool  bLogESPos tXML)
  207           {
  208  
  209  
  210  
  211  
  212  
  213                string s RTN = stri ng.Empty;
  214  
  215  
  216                int m_ti meOut = 60 ;
  217                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  218                // Make  sure we ha ve some da ta to send .
  219                if (m_po st_data.Le ngth == 0)
  220                {
  221                    sRTN  = "ERR: P OST data w as empty." ;
  222                    retu rn sRTN;
  223                }
  224                if (bLog ESPostXML)
  225                {
  226                    stri ng cDri =  Environmen t.CommandL ine;
  227                    cDri  = cDri.Re place("AET Service.ex e", "");
  228                    cDri  = cDri.Re place("\"" , "");
  229                    stri ng ESPostF ile = Stri ng.Format( "{0}{1}_ES Request.xm l", cDri,  m_logid);
  230                    usin g (System. IO.StreamW riter writ er = new S ystem.IO.S treamWrite r(ESPostFi le, false) )
  231                    {
  232                         writer.Wri te(m_post_ data);
  233                         writer.Clo se();
  234                    }
  235                }
  236                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  237                // Insta ll out SSL  CertValid ation call  back func tion
  238                ServiceP ointManage r.ServerCe rtificateV alidationC allback =  MyCertVali dationCb;
  239                byte[] p ostBytes =  Encoding. ASCII.GetB ytes(m_pos t_data);     // turn  our reques t string i nto a byte  stream
  240                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  241                // Creat e out http (s) reques t & load t he URL
  242                HttpWebR equest req uest = (Ht tpWebReque st)
  243                WebReque st.Create( m_url);
  244  
  245                // The c ertificate  was loade d so popul ate (ONLY  THE ONES N EEDED) the  rest of t he Http(s)  request v alues.
  246                request. Method = " POST";
  247                request. KeepAlive  = true;
  248                request. ProtocolVe rsion = Ht tpVersion. Version10;
  249  
  250                request. ContentTyp e = "text/ xml; chars et=utf-8";
  251                request. ContentLen gth = post Bytes.Leng th; // thi s is impor tant - mak e sure you  specify t ype this w ay
  252  
  253                request. Timeout =  1000 * m_t imeOut;
  254                request. AllowAutoR edirect =  true; 
  255  
  256                ServiceP ointManage r.Expect10 0Continue  = true;
  257                ServiceP ointManage r.Security Protocol =  SecurityP rotocolTyp e.Ssl3 | S ecurityPro tocolType. Tls | Secu rityProtoc olType.Tls 11 | Secur ityProtoco lType.Tls1 2;
  258  
  259                // Keith  Baldwin 5 /18/2016 -  MVI call  was blowin g up so I  logged a l ot of info rmation
  260                //Loggin g.WriteLog File("");
  261                //Loggin g.WriteLog File("ES m _url: " +  m_url);
  262                ////Logg ing.WriteL ogFile("ES  m_sCertNa me: " + m_ sCertName) ;
  263                ////Logg ing.WriteL ogFile("ES  m_mvipayl oad: " + m _mvipayloa d);
  264                ////Logg ing.WriteL ogFile("ES  bLogMVIPo stXML: " +  bLogMVIPo stXML);
  265                //Loggin g.WriteLog File("ES R equest.Uri : " + requ est.Reques tUri.ToStr ing());
  266                //Loggin g.WriteLog File("ES R equest.Met hod: " + r equest.Met hod);
  267                //Loggin g.WriteLog File("ES R equest.Con tentType:  " + reques t.ContentT ype);
  268                //Loggin g.WriteLog File("ES R equest.Con tentLength : " + requ est.Conten tLength);
  269                ////Logg ing.WriteL ogFile("Re quest.Meth od: " + re quest.Meth od);
  270                //Servic ePointMana ger.Securi tyProtocol  = Securit yProtocolT ype.Ssl3 |  SecurityP rotocolTyp e.Tls | Se curityProt ocolType.T ls11 | Sec urityProto colType.Tl s12;
  271                //if ((S ervicePoin tManager.S ecurityPro tocol & Se curityProt ocolType.S sl3) == Se curityProt ocolType.S sl3)
  272                    //Lo gging.Writ eLogFile(" ES: SSL 3  is availab le for sec urity prot ocol");
  273                //if ((S ervicePoin tManager.S ecurityPro tocol & Se curityProt ocolType.T ls) == Sec urityProto colType.Tl s)
  274                    //Lo gging.Writ eLogFile(" ES: TLS 1. 0 is avail able for s ecurity pr otocol");
  275                //if ((S ervicePoin tManager.S ecurityPro tocol & Se curityProt ocolType.T ls11) == S ecurityPro tocolType. Tls11)
  276                    //Lo gging.Writ eLogFile(" ES: TLS 1. 1 is avail able for s ecurity pr otocol");
  277                //if ((S ervicePoin tManager.S ecurityPro tocol & Se curityProt ocolType.T ls12) == S ecurityPro tocolType. Tls12)
  278                    //Lo gging.Writ eLogFile(" ES: TLS 1. 2 is avail able for s ecurity pr otocol");
  279                ////Logg ing.WriteL ogFile("ES  m_post_da ta: " + m_ post_data) ;
  280                //Loggin g.WriteLog File("");
  281  
  282                Stream r equestStre am = reque st.GetRequ estStream( );   // Cr eat a Requ est Stream .
  283                requestS tream.Writ e(postByte s, 0, post Bytes.Leng th); // No w send it.
  284                requestS tream.Clos e();
  285  
  286                string s c = string .Empty;
  287                string x mlData = s tring.Empt y;
  288  
  289  
  290                try
  291                {
  292  
  293                    // G rab te res ponse and  print it o ut to the  console al ong with t he status  code
  294                    Http WebRespons e response  = (HttpWe bResponse) request.Ge tResponse( );
  295                    sc =  response. StatusCode .ToString( );
  296                    usin g (StreamR eader sr =  new Strea mReader(re sponse.Get ResponseSt ream()))
  297                    {
  298                         xmlData =  sr.ReadToE nd();
  299                    }
  300  
  301                    if ( bLogESPost XML)
  302                    {
  303                         string cDr i = Enviro nment.Comm andLine;
  304                         cDri = cDr i.Replace( "AETServic e.exe", "" );
  305                         cDri = cDr i.Replace( "\"", "");
  306                         string ESP ostFile =  String.For mat("{0}{1 }_ESRespon se.xml", c Dri, m_log id);
  307                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(ESPo stFile, fa lse))
  308                         {
  309                             writer .Write(xml Data);
  310                             writer .Close();
  311                         }
  312                    }
  313                    try
  314                    {
  315  
  316  
  317                         ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ///////
  318                         // Variabl e’s needed  to extrac t and dete rmine the  proper dem ographics  informatio n.
  319                         string add ressTypeCo de = strin g.Empty;
  320                         string add ressChange EffectiveD ate = stri ng.Empty;
  321                         string add ressChange DateTime =  string.Em pty;
  322                         string end Date = str ing.Empty;
  323  
  324                         string Tli ne1 = stri ng.Empty;
  325                         string Tci ty = strin g.Empty;
  326                         string Tst ate = stri ng.Empty;
  327                         string Tzi pCode = st ring.Empty ;
  328                         string Tzi pPlus4 = s tring.Empt y;
  329                         string Tba dAddressRe ason = str ing.Empty;
  330  
  331                         string Pli ne1 = stri ng.Empty;
  332                         string Pci ty = strin g.Empty;
  333                         string Pst ate = stri ng.Empty;
  334                         string Pzi pCode = st ring.Empty ;
  335                         string Pzi pPlus4 = s tring.Empt y;
  336                         string Pba dAddressRe ason = str ing.Empty;
  337                         bool bHasT emp = fals e;
  338                         bool bHasE ndDate = f alse;
  339  
  340                         DateTime T dateTime =  DateTime. Now;
  341                         DateTime P dateTime =  DateTime. Now;
  342  
  343                         m_espayloa d = xmlDat a;
  344  
  345                         XmlDocumen t xd = new  XmlDocume nt();
  346                         xd.LoadXml (xmlData);
  347                         // Apply n ecessary X ML namespa ce
  348                         XmlNamespa ceManager  nsMan = ne w XmlNames paceManage r(xd.NameT able);
  349                          nsMan.AddN amespace(" ee", "http :// DNS . URL         /schemas") ;
  350  
  351  
  352                         //ZEB VA11 8-11-D-100 9 9/9/13 ( +9) Detect  condition  where ES  returns em pty respon se and ret urn approp riate erro r
  353                         XmlNodeLis t summary  = xd.GetEl ementsByTa gName("sum mary");
  354                         if (summar y.Count ==  0)
  355                         {
  356                             return  "NF";
  357                         }
  358                         if (!summa ry[0].HasC hildNodes)
  359                         {
  360                             return  "NF";
  361                         }
  362  
  363                         ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ///////
  364                         // Setup t o extract  the demogr aphics inf ormation f rom the ES  payload.
  365                         XmlElement  demograph ics = (Xml Element)xd .GetElemen tsByTagNam e("demogra phics")[0] ;
  366                         XmlElement  contactIn fo = (XmlE lement)dem ographics. GetElement sByTagName ("contactI nfo")[0];
  367                         XmlElement  addresses  = (XmlEle ment)conta ctInfo.Get ElementsBy TagName("a ddresses") [0];
  368                         XmlNodeLis t idNodes  = addresse s.GetEleme ntsByTagNa me("addres s");
  369                         foreach (X mlNode idN ode in idN odes)
  370                         {
  371  
  372                             // Ext ratc the T emporary a nd Permane nt address  informati on.
  373                             try {  addressTyp eCode = id Node["addr essTypeCod e"].InnerT ext; }
  374                             catch  { }
  375  
  376                             // Ext ract the T emporary a ddress inf ormation..
  377                             if (ad dressTypeC ode == "Te mporary")
  378                             {
  379                                 tr y
  380                                 {
  381                                      endDate  = idNode[" endDate"]. InnerText;
  382                                      string[]  md = endD ate.Split( 'T');
  383                                      if (md.A ny())
  384                                          endD ate = md[0 ];
  385                                      endDate  = endDate. Replace("- ", "");
  386                                      if (endD ate.Length  == 8)
  387                                      {
  388                                          int  y = int.Pa rse(endDat e.Substrin g(0, 4));
  389                                          int  m = int.Pa rse(endDat e.Substrin g(4, 2));
  390                                          int  d = int.Pa rse(endDat e.Substrin g(6, 2));
  391                                          Tdat eTime = ne w DateTime (y, m, d);
  392                                          bHas EndDate =  true;
  393                                      }
  394  
  395                                 }
  396                                 ca tch { bHas EndDate =  false; }
  397  
  398                                 tr y { TbadAd dressReaso n = idNode ["badAddre ssReason"] .InnerText ; }
  399                                 ca tch { }
  400                                 if  (TbadAddr essReason. Length ==  0)
  401                                 {
  402                                      try { Tz ipPlus4 =  idNode["zi pPlus4"].I nnerText;  }
  403                                      catch {  }
  404                                      try { Tz ipCode = i dNode["zip Code"].Inn erText; }
  405                                      catch {  }
  406                                      try { Ts tate = idN ode["state "].InnerTe xt; }
  407                                      catch {  }
  408                                      try { Tc ity = idNo de["city"] .InnerText ; }
  409                                      catch {  }
  410                                      try { Tl ine1 = idN ode["line1 "].InnerTe xt; }
  411                                      catch {  }
  412                                 }
  413  
  414                                 bH asTemp = t rue;
  415                             }
  416                             // Ext ract the P ermanent a ddress inf ormation..
  417                             else i f (address TypeCode = = "Permane nt")
  418                             {
  419  
  420  
  421                                 tr y { PbadAd dressReaso n = idNode ["badAddre ssReason"] .InnerText ; }
  422                                 ca tch { }
  423                                 if  (PbadAddr essReason. Length ==  0)
  424                                 {
  425                                      try { Pz ipPlus4 =  idNode["zi pPlus4"].I nnerText;  }
  426                                      catch {  }
  427                                      try { Pz ipCode = i dNode["zip Code"].Inn erText; }
  428                                      catch {  }
  429                                      try { Ps tate = idN ode["state "].InnerTe xt; }
  430                                      catch {  }
  431                                      try { Pc ity = idNo de["city"] .InnerText ; }
  432                                      catch {  }
  433                                      try { Pl ine1 = idN ode["line1 "].InnerTe xt; }
  434                                      catch {  }
  435                                 }
  436                             }
  437                         }
  438  
  439                         if (bHasTe mp)
  440                         {
  441                             if (bH asEndDate)
  442                             {
  443  
  444                                 if  (DateTime .Compare(T dateTime,  PdateTime)  >= 0)
  445                                 {
  446                                      if (Tlin e1.Length  > 0)
  447                                      {
  448  
  449                                          Plin e1 = Tline 1;
  450                                          Pcit y = Tcity;
  451                                          Psta te = Tstat e;
  452                                          Pzip Code = Tzi pCode;
  453  
  454                                      }
  455                                 }
  456                             }
  457                             else
  458                             {
  459                                 if  (Tline1.L ength > 0)
  460                                 {
  461  
  462                                      Pline1 =  Tline1;
  463                                      Pcity =  Tcity;
  464                                      Pstate =  Tstate;
  465                                      PzipCode  = TzipCod e;
  466  
  467                                 }
  468  
  469                             }
  470  
  471                         }
  472  
  473                         m_line1 =  Pline1;
  474                         m_city = P city;
  475                         m_state =  Pstate;
  476                         m_zipcode  = PzipCode ;
  477  
  478  
  479                         string sta tus;
  480                         string sta tusDateStr ing;
  481  
  482                         // Get eli gibilitySt atus
  483                         try { stat us = xd.Se lectSingle Node("//ee :eligibili tyStatus",  nsMan).In nerText; }
  484                         catch { }
  485  
  486                         // Get eli gibilitySt atusDate
  487                         try { stat usDateStri ng = xd.Se lectSingle Node("//ee :eligibili tyStatusDa te", nsMan ).InnerTex t; }
  488                         catch { }
  489                         // Get enr ollmentDat e
  490                         try { m_Ed ate = xd.S electSingl eNode("//e e:enrollme ntDate", n sMan).Inne rText; }
  491                         catch { }
  492                         // Get enr ollmentSta tus
  493                         try { m_Es tatus = xd .SelectSin gleNode("/ /ee:enroll mentStatus ", nsMan). InnerText;  }
  494                         catch { }
  495  
  496  
  497                         sRTN = "OK !";
  498                    }
  499                    catc h (Excepti on ex)
  500                    {
  501                         // Write a ny excepti ons to a l og file.
  502  
  503                         string err Msg = Stri ng.Format( "[{0}]-ES- 1 Exceptio n: {1}", m _logid, ex .Message);
  504                         //System.D iagnostics .EventLog. WriteEntry ("AETServi ce", errMs g, System. Diagnostic s.EventLog EntryType. Error, 200 , 500);
  505                         sRTN = "NX ";
  506  
  507  
  508                    }
  509  
  510                }
  511                catch (S ystem.Net. WebExcepti on ex)
  512                {
  513                    // W rite any e xceptions  to a log f ile.
  514  
  515                    m_es payload =  ex.Message ;
  516                    stri ng errMsg  = String.F ormat("[{0 }]-ES-2 Ex ception: { 1}", m_log id, ex.Mes sage);
  517                    //Sy stem.Diagn ostics.Eve ntLog.Writ eEntry("AE TService",  errMsg, S ystem.Diag nostics.Ev entLogEntr yType.Erro r, 201, 50 0);
  518  
  519                    stri ng cDri =  Environmen t.CommandL ine;
  520                    cDri  = cDri.Re place("AET Service.ex e", "");
  521                    cDri  = cDri.Re place("\"" , "");
  522                    stri ng ESPostF ile = Stri ng.Format( "{0}{1}_ES Responce.x ml", cDri,  m_logid);
  523  
  524  
  525                    Http WebRespons e response 1 = (HttpW ebResponse )ex.Respon se;
  526                    usin g (StreamR eader sr1  = new Stre amReader(r esponse1.G etResponse Stream()))
  527                    {
  528                         xmlData =  sr1.ReadTo End();
  529                    }
  530                    if ( response1. StatusCode  == HttpSt atusCode.I nternalSer verError)
  531                    {
  532                         errMsg = S tring.Form at("[{0}]- ES-3 Excep tion-Data:  {1}", m_l ogid, xmlD ata);
  533                         //System.D iagnostics .EventLog. WriteEntry ("AETServi ce", errMs g, System. Diagnostic s.EventLog EntryType. Error, 201 , 500);
  534                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(ESPo stFile, fa lse))
  535                         {
  536                             writer .Write(xml Data);
  537                             writer .Close();
  538  
  539                         }
  540  
  541                         if (xmlDat a.Contains ("No Recor d Found: I CN/VPID Do es Not Exi st:"))
  542                         {
  543                             sRTN =  "NF";
  544                         }
  545                         else
  546                         {
  547  
  548                             sRTN =  "NX";
  549                         }
  550                    }
  551                    else
  552                    {
  553  
  554                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(ESPo stFile, fa lse))
  555                         {
  556                             sRTN =  "ERR:" +  ex.Message ;
  557                             writer .Write(ex. Message);
  558                             writer .Close();
  559                         }
  560  
  561                    }
  562  
  563  
  564  
  565  
  566  
  567  
  568  
  569  
  570  
  571  
  572  
  573                    //st ring LogFi le = @"C:\ ES_Excepti on.txt";
  574                    //us ing (Syste m.IO.Strea mWriter wr iter = new  System.IO .StreamWri ter(LogFil e, false))
  575                    //{
  576                    //sR TN = "ERR: " + ex.Mes sage.ToStr ing();
  577                    //wr iter.Write (ex.Messag e.ToString ());
  578                    //wr iter.Close ();
  579                    //}
  580  
  581  
  582                }
  583  
  584                return s RTN;
  585           }
  586  
  587       }
  588   }