Exemplo n.º 1
0
        static async Task registrarAvanceTipoRegistroUno()
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://52.26.20.117/servicio/TramiteDocumentario/");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));


                var Avance = new AvanceDto() { TipoRegistro = "1", 
                                                              FechaAvance = "14/11/2015", 
                                                              Observaciones ="Tramite",
                                                              IdTipoTramiteEstado = "1",
                                                              IdTramite = "1"
                                                              };

                HttpResponseMessage response = await client.PostAsJsonAsync("Tramite.svc/avance", Avance);

                if (response.IsSuccessStatusCode)
                {
                    AvanceResponse _ResponseMessage = await response.Content.ReadAsAsync<AvanceResponse>();
                    Console.WriteLine("ResponseMessage TipoRegistro 1 : " + _ResponseMessage._HeadMessage.ResponseCode);

                }
            }
        }
Exemplo n.º 2
0
        static async Task registrarAvanceTipoRegistroDos()
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://52.26.20.117/servicio/TramiteDocumentario/");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));


                var Avance = new AvanceDto()
                {
                    TipoRegistro = "2",
                    IdTramite = "1",
                    DetalleExpediente = new DetalleTramiteDto() { 
                         CodigoRequisito = "1",
                         InformacionRequisito = "Numero de solicitud",
                         RutaArchivo = "/modelo/trama/planos2.pdf"
                    }
                };

                HttpResponseMessage response = await client.PostAsJsonAsync("Tramite.svc/avance", Avance);

                if (response.IsSuccessStatusCode)
                {
                    AvanceResponse _ResponseMessage = await response.Content.ReadAsAsync<AvanceResponse>();
                    Console.WriteLine("ResponseMessage TipoRegistro 2 : " + _ResponseMessage._HeadMessage.ResponseCode);

                }
            }
        }