public override void TestPerformed()
        {
            RunProcessRequest process = new RunProcessRequest();

            process.WebServiceType = GetWebServiceType();
            process.Login          = GetLogin();

            ParamValues paramsV = new ParamValues();

            paramsV.AddField("C_BPartner_ID", "50003");
            process.ParamValues = paramsV;

            WebServiceConnection client = GetClient();

            try {
                RunProcessResponse response = client.SendRequest(process);

                if (response.Status == WebServiceResponseStatus.Error)
                {
                    Console.WriteLine(response.ErrorMessage);
                }
                else
                {
                    Console.WriteLine(response.Summary);
                }
            } catch (Exception e) {
                Console.WriteLine(e);
            }
        }
Beispiel #2
0
        public async ValueTask <IActionResult> Run(RunProcessRequest req)
        {
            try
            {
                var r = await api.RunAsync(req);

                return(Ok(new RunProcessResponse(r, false)));
            }
            catch (ApiException e)
            {
                return(StatusCode(422, new ErrorResponse(e)));
            }
        }
Beispiel #3
0
        public static void main(String[] args)
        {
            RunProcessRequest runProcess = new RunProcessRequest();

            runProcess.WebServiceType = "RunProcess";
            runProcess.Login          = getLogin();

            // Pega as inforamções da conexão
            WebServiceConnection client = getClient();

            try
            {
                //Envia a operação, que nesse caso é um criar, e armazena a resposta enviada pelo server
                RunProcessResponse response = client.SendRequest(runProcess);

                Console.WriteLine("XML ENVIADO AO SERVIDOR\n");
                client.WriteRequest(Console.Out);
                Console.WriteLine();
                Console.WriteLine("XML DE RESPOSTA DO SERVIDOR\n");
                client.WriteResponse(Console.Out);
                Console.WriteLine();

                // Verifica se ocorreu algum erro ao executar a operação e exibe o erro
                if (response.Status == WebServiceResponseStatus.Error)
                {
                    Console.WriteLine(response.ErrorMessage);
                }

                Console.WriteLine("--------------------------");
                Console.WriteLine("Web Service: RunProcess");
                Console.WriteLine("Attempts: " + client.AttemptsRequest);
                Console.WriteLine("Time: " + client.TimeRequest);
                Console.WriteLine("--------------------------");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            finally
            {
                Console.ReadLine();  //Impede o Console de fechar automaticamente
            }
        }
Beispiel #4
0
 /// <summary>
 /// Send request for run process web service
 /// </summary>
 /// <param name="request">Request to send</param>
 /// <returns>Response model</returns>
 public RunProcessResponse SendRequest(RunProcessRequest request)
 {
     return((RunProcessResponse)SendRequest((WebServiceRequest)request));
 }