How to consume web service XML SOAP https with C# . Net Core 2.0?

Asked

Viewed 1,966 times

-1

I referenced the WSDL by WCF from Visual Studio 2007, and created a simple class to test the communication, I can’t understand what’s wrong, I get the error : "Could not Establish trust Relationship for the SSL/TLS Secure Channel with Authority".

I’ve done several searches on the web and here on the stack, but nothing worked.

I did a test with the mail webservices, which is also in Https, works smoothly, but when running the call to the other gives this error. By Soapui, it works normally, someone can give help?

try
{

  VV_OptOutClient Soapclient = new VV_OptOutClient();

  var soapreturn = await Soapclient.atualizarOptOutAsync(obj);

  return soapreturn.retornoOptout;

}
catch (Exception e)
{

  throw new Exception(e.Message);

}
  • How was the configuration of your endpoint in the configuration file?

  • I just added a reference to the connected services, then the reference service was created, which allows me to access it by Vv_optoutclient, understood?

  • Get it, check web.config or appsettings for how endpoint is set up

  • I believe it is in order, the default has been created. "Extendeddata": { "Uri":"https://domain/vv/operacao_stores/optout/update/SOAP/v1? wsdl", "Namespace": "Wsoptout", "Selectedaccesslevelforgeneratedclass": "Public", "Generatemessagecontract": false, "Reusetypesinreferencedassemblies": true, "Reusetypesinallreferencedassemblies": , "Collectiontypereference": { "Item1": "System.Array", "Item2": "System.Runtime.dll" },

1 answer

0


Good,

I couldn’t find a solution when using references (WCF), so I did it with Webrequest, ignoring protocols Tls, Ssl, and circumventing certificate validation.

If anyone ever finds an answer, please include.

Thank you very much!

Browser other questions tagged

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