berlangajimenez

Send parameter by POST to geoprocesing   ArcGisServer

Discussion created by berlangajimenez on Feb 26, 2013
Hi,

I have a toolbox published to ArcGIS Server, the call from my application  web client (by POST) and always get the following error:

base {"Error en el servidor remoto: (500) Error interno del servidor."} System.InvalidOperationException {System.Net.WebException}

Status ProtocolError System.Net.WebExceptionStatus

code:

String parametrosPolCorte = string.Format("input_identificador={0}&input_operacion={1}&input_cerrada={2}&input_averiada={3}&input_criterio={4}", geometria, operacion, cerrada, averiada, criterio);

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(baseURL.Substring(0, baseURL.Length - 1));
        request.Method = "POST";
        request.ContentType = "application/x-www-form-urlencoded";

        var postData = Encoding.UTF8.GetBytes(parametrosPolCorte);
        request.ContentLength = postData.Length;

        using (var requestStream = request.GetRequestStream())
        {
            requestStream.Write(postData, 0, postData.Length);
        }
        response = (HttpWebResponse)request.GetResponse();
        Stream resStream = response.GetResponseStream();


Thanks,

Outcomes