Exemplo n.º 1
0
        public void Edit_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1347649273856884Ser_3_Alias", NaveNodrizaClassText.Edit_instanceServiceAlias, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_thisNaveNodriza", false, "NaveNodriza", "Clas_1347649273856884Ser_3Arg_1_Alias", NaveNodrizaClassText.Edit_instance_P_thisNaveNodrizaArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias, "Clas_1347649273856884Ser_3_Alias", NaveNodrizaClassText.Edit_instanceServiceAlias);
            }

            NaveNodrizaOid lP_thisNaveNodrizaArg = (NaveNodrizaOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_thisNaveNodriza"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            NaveNodrizaInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                NaveNodrizaInstance lThisInstance = new NaveNodrizaInstance(lOnContext);
                if (lP_thisNaveNodrizaArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new NaveNodrizaHorizontalVisibility());
                    lThisInstance = lP_thisNaveNodrizaArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);
                }

                using (NaveNodrizaServer lServer = new NaveNodrizaServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisNaveNodrizaArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement(); // Arguments
        }
Exemplo n.º 2
0
        public void Create_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1347649273856884Ser_1_Alias", NaveNodrizaClassText.Create_instanceServiceAlias, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);
            lSInfo.AddDataValuedArgument("p_atrid_NaveNodriza", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1347649273856884Ser_1Arg_1_Alias", NaveNodrizaClassText.Create_instance_P_atrid_NaveNodrizaArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrNombre_NaveNodriza", false, DataTypeEnumerator.String, 100, "Clas_1347649273856884Ser_1Arg_2_Alias", NaveNodrizaClassText.Create_instance_P_atrNombre_NaveNodrizaArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias, "Clas_1347649273856884Ser_1_Alias", NaveNodrizaClassText.Create_instanceServiceAlias);
            }

            ONInt lP_atrid_NaveNodrizaArg = (ONInt) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrid_NaveNodriza"]).Value;
            ONString lP_atrNombre_NaveNodrizaArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrNombre_NaveNodriza"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            NaveNodrizaInstance lInstance = null;
            try
            {
                using (NaveNodrizaServer lServer = new NaveNodrizaServer(lOnContext, null))
                {
                    lServer.Create_instanceServ(lP_atrid_NaveNodrizaArg,lP_atrNombre_NaveNodrizaArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement(); // Arguments
        }