Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

WCF HTTPS service consumed inside plugins throwing error - System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToke

Posted on by 580

#region Calling WCF Service
var myBinding = new WSHttpBinding(SecurityMode.None);
//binding.Security.Mode = WSDualHttpSecurityMode.None;
myBinding.MaxReceivedMessageSize = 2147483647;
myBinding.MaxBufferPoolSize = 2147483647;
myBinding.SendTimeout = TimeSpan.FromMinutes(3);
myBinding.ReceiveTimeout = TimeSpan.FromMinutes(3);
myBinding.OpenTimeout = TimeSpan.FromMinutes(3);
myBinding.CloseTimeout = TimeSpan.FromMinutes(3);
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
myBinding.Security.Message.EstablishSecurityContext = false;
myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

EndpointAddress endPointAddress = new EndpointAddress("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.svc");
ChannelFactory<ICustSupportService> factory = new ChannelFactory<ICustSupportService>(myBinding, endPointAddress);
ICustSupportService channel = factory.CreateChannel();

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans