Код: Выделить всё
2019-02-08T12:59:00.067Z
2019-02-08T13:32:20.067Z
MIIGgjCCBGqgAwIB…
BwIgcnbARGgMPWeDrjR52LGfEf6j/WcF8eE1MQt/MSQ=
NDNJrnpAfEcBvCeNvlk3EhMQy8YkL+86XKPHNHkklag=
VZrfhemL9OWCsxmN2x4ymGo8LqhyhN1vDyOaQmmEMcA=
wRYqFkSq1EU4D6E2dapniCnXAYW4kPWuZ0k/pKnTnkI=
22
WFpN2A3HvK+b6j4tdgw/N+0DgHnI4THLyQsz8JnA8jY=
U3f4vdrlrYtSMJ+zXmJ+RyvWt6gZEF9WoiT7dmD2YbL8SYzztOl/foyKLbj9fs8yEqGOL7YEZmev RrQxfePZ7FhP/dW7kBHkhXrUrzYakEA3Tdl21vPwtdNeq0NS9DzASUMPMdWESTDo+qDdzN4HO7MD H4ZQFa8ZuIrJ4Kuo46Ha7Lx/LH2uM0dJBR/XA49LrDqecmdwxV7poELoqsVv4v0kF9iuQI6eeqnW fjDveJ7C/aF1xwl+BB/vtJlaZrd1r9GAsgfZCEfOlLdaTkqGYPd8flQuBaf9hBfY+RKJSFfMmgz4 kaax0DumfavDnTrZ8fn2iI4dlEW10EkLqMqFfg==
Я дошел до этого:
Код: Выделить всё
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
ServicePointManager.ServerCertificateValidationCallback +=
(se, cert, chain, sslerror) =>
{
return true;
};
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12;
WSHttpBinding binding = new WSHttpBinding();
binding.Security = new WSHttpSecurity()
{
Mode = SecurityMode.Transport,
Transport = new HttpTransportSecurity()
{
ClientCredentialType = HttpClientCredentialType.Certificate,
}
};
binding.Security.Mode = SecurityMode.TransportWithMessageCredential;
binding.Security.Message.ClientCredentialType = MessageCredentialType.Certificate;
binding.Security.Message.EstablishSecurityContext = false;
binding.Security.Message.NegotiateServiceCredential = false;
binding.Security.Message.AlgorithmSuite = SecurityAlgorithmSuite.Basic256Sha256;
//https://xml-test.duo.nl:6990/vsv-webservice/services/DUO_RelatiefVerzuim_V13
EndpointAddress endpointAddress = new EndpointAddress("https://xml-test.duo.nl:6990/vsv-webservice/services/DUO_RelatiefVerzuim_V13");
DuoClient duoClient = new DuoClient(binding, endpointAddress);
duoClient.ClientCredentials.ClientCertificate.Certificate = new X509Certificate2("D:\\Temp\\*******.pfx", "**********");
duoClient.ChannelFactory.Endpoint.EndpointBehaviors.Add(new LoggingEndpointBehavior());
try
{
using (OperationContextScope scope = new OperationContextScope(duoClient.InnerChannel))
{
OperationContext.Current.OutgoingMessageHeaders.To = new Uri("http://www.w3.org/2005/08/addressing/anonymous?oin=00000001800866472000");
OperationContext.Current.OutgoingMessageHeaders.From = new EndpointAddress("http://www.w3.org/2005/08/addressing/anonymous?oin=0000000700025MB00000");
OperationContext.Current.OutgoingMessageHeaders.MessageId = new System.Xml.UniqueId(Guid.NewGuid());
//OperationContext.Current.OutgoingMessageHeaders.Action = "http://duo.nl/contract/DUO_Ping_V1/ping";
// One-way
var response = duoClient.meldenRelatiefVerzuim_V7(new MeldenRelatiefVerzuim_V7_Request()
{
bRIN = "",
contactpersoon = new Contact()
{
contactnaam = "",
emailadres = "",
functieContact = "",
telefoonnummer = ""
}
});
//OperationContext.Current.Extensions.Add(new LoggingEndpointBehavior());
// Done with service.
duoClient.Close();
Console.WriteLine("Done!");
Console.ReadLine();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadKey();
}
Код: Выделить всё
http://duo.nl/contract/DUO_RelatiefVerzuim_V13/meldenRelatiefVerzuim_V7
http://www.w3.org/2005/08/addressing/anonymous?oin=00000001800866472000
http://www.w3.org/2005/08/addressing/anonymous?oin=0000000700025MB00000
urn:uuid:96c4c3c5-73f2-4f7a-849a-3a5613d1a4c4
61878aaf-b8d7-4bc0-800f-26a25c3e8b29
http://www.w3.org/2005/08/addressing/anonymous
0001-01-01T00:00:00
Кто-нибудь знает, как это исправить?
редактировать:
Я пробовал это в .net 8.0, но очень мало примеров кода о том, как wcf работает в .net 8. Я даже не смог заставить TLS работать в .net 8. Сертификат сервера является самоподписанным, и мне нужно переопределить проверку что не сработало. По крайней мере, не так, как в .net4.8 или любом из онлайн-примеров.
Подробнее здесь: https://stackoverflow.com/questions/791 ... ty-headers