Httpwebrequest Proxy-Connection Set

Asked

Viewed 81 times

0

I’m trying to accomplish the WCF sending via SOAP. Can send via SOAPUI, as picture there is the parameter "Proxy-Connection":

inserir a descrição da imagem aqui

In C# there is no such parameter "Proxy-Connection":

        HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://flnws001qae.nexxera.com:80/nexxeraws/v2/SkylineWSv2");
        req.Method = "POST";
        req.Headers.Add("Accept-Encoding", "gzip,deflate");
        req.ContentType = "multipart/related; type=\"text/xml\"; start=\"<[email protected]>\"; boundary=\"---- = _Part_62_642526802.1564766469118\"";
        req.Headers.Add("SOAPAction", "");
        req.Headers.Add("MIME-Version", "1.0");
        req.Host = "flnws001qae.nexxera.com:80";
        req.UserAgent = "Apache-HttpClient/4.1.1 (java 1.5)";
        req.KeepAlive = false;

        re.proxy-connection = "keep-alive" //não existe método
        req.Headers.Add("Proxy-Connection", "Keep-Alive"); //erro {"O cabeçalho 'Proxy-Connection' deve ser modificado com a propriedade ou o método adequado.\r\nNome do parâmetro: name"}

Does anyone know how to pass the value to Proxy-Connection?

  • but in soapui, you are using credentials (user/password)?

  • Ricardo yes I pass inside the header.

  • then what you need to do is set your credentials in the object req.Credentials, for example like: req.Credentials = new System.Net.NetworkCredential("usuario", "senha");

  • Ricardo I’m already passing the credentials. But I have the return Error 500, the only thing I saw other than soapui and my application is this parameter "Proxy-Connection", I want to pass this field by parameter. As described I’m not getting through.

  • whenever I used authentication this header is controlled by wcf, I don’t think I can explicitly set it, but I’m sure it’s added, but I don’t usually create the call using HttpWebRequest, it is necessary to let . net create the proxy classes when I import the contract, so I use the ClientCredentials and works well

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.