Exemple #1
0
        static public void initLocations(IGxContext context,
                                         GXXMLReader oReader)
        {
            String     sSection;
            String     sName;
            short      nFirstRead;
            GxLocation oLocation;

            context.nLocRead     = 1;
            context.colLocations = new GxLocationCollection();
            if (oReader.ErrCode == 0)
            {
                if (oReader.ReadType(1, "GXLocations") > 0)
                {
                    oReader.Read();
                    while (!((StringUtil.StrCmp(oReader.Name, "GXLocations") == 0) && (oReader.NodeType == 2)))
                    {
                        if ((StringUtil.StrCmp(oReader.Name, "GXLocation") == 0) && (oReader.NodeType == 1))
                        {
                            sName            = oReader.GetAttributeByName("name");
                            oLocation        = context.colLocations.GetItem(sName);
                            context.nSOAPErr = 0;
                            if (oLocation == null)
                            {
                                context.nSOAPErr = 1;
                            }
                            if (context.nSOAPErr != 0)
                            {
                                /* Error while reading XML. Code:  4 . Message:  Input error . */
                                oLocation                        = new GxLocation();
                                oLocation.Name                   = sName;
                                oLocation.Host                   = "localhost";
                                oLocation.Port                   = 80;
                                oLocation.BaseUrl                = "/";
                                oLocation.Secure                 = 0;
                                oLocation.ProxyServerHost        = "";
                                oLocation.ProxyServerPort        = 0;
                                oLocation.Timeout                = 0;
                                oLocation.CancelOnError          = 0;
                                oLocation.Authentication         = 0;
                                oLocation.AuthenticationMethod   = 0;
                                oLocation.AuthenticationRealm    = "";
                                oLocation.AuthenticationUser     = "";
                                oLocation.AuthenticationPassword = "";
                                oLocation.GroupLocation          = "";
                                context.colLocations.Add(oLocation, sName);
                            }
                            oLocation.GroupLocation = "";
                            nFirstRead = 1;
                            oReader.Read();
                            while (!((StringUtil.StrCmp(oReader.Name, "GXLocation") == 0) && (oReader.NodeType == 2)))
                            {
                                sSection = read_section(context, oReader, oLocation);
                                if (((StringUtil.StrCmp(sSection, "Common") == 0) && (nFirstRead == 1)) || (StringUtil.StrCmp(sSection, "HTTP") == 0))
                                {
                                    nFirstRead = 0;
                                }
                                oReader.Read();
                            }
                        }
                        oReader.Read();
                    }
                }
            }
        }