0
I’m trying to accomplish the WCF sending via SOAP. Can send via SOAPUI, as picture there is the parameter "Proxy-Connection":
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 Pontual
Ricardo yes I pass inside the header.
– Tiago Casanova
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 Pontual
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.
– Tiago Casanova
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 theClientCredentials
and works well– Ricardo Pontual