Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

plugin error accessing server that has implemented X-FRAME-OPTION = DENY

Posted on by 30

I'm administering  on premise instance of MS dynamics 365 V8 .  this instance contains a plugin that sync data to a FileNet instance using SOAP call .  this process has been working in production for several year. recently our server administrator has implemented a new security protocol to turn on the "xframe-option = DENY".  after this change all calls to the server are return the following error :

Exception message: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
the information about the call is the following :
  • MS Dynamics on premise V8.2
  • Vendor API call within C# plugin
  • Plugin is registered in the Sandbox
My question is has any one encountered this issues and is there a soliton is to override one of the header setting .   research that I've done has brought some option but most are for ASP.net and require changes in the app.config file (see below)  .  as far as I know dynamics plugin do not have access to config files.  Research, the consensus is to use the following in your C# or ASP.NET application :
Add following to app.config :
<configuration>
 <system.net>
  <settings>
   <httpWebRequest useUnsafeHeaderParsing="true" />
  </settings>
 </system.net>
</configuration>
Additional test done : Since I'm using a Vendor API call it not always possible to determine if the problem is with the API from the connection .  I was able successfully test the error using a simple HTTP request in my plugin

try
{
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.Expect100Continue = true;
WebResponse responseObj = request.GetResponse();
Stream dataStream = responseObj.GetResponseStream();
StreamReader streamReader = new StreamReader(dataStream);
response += "Response: \n";
response += streamReader.ReadToEnd();
entity["statuscode"] = new OptionSetValue(1);
}
catch (Exception ex)
{
response += "Error: " + ex.Message;
response += "\n";
response += ex.StackTrace;
response += "\n\n";
response += ex.HelpLink;
entity["statuscode"] = new OptionSetValue(960380000); //error status
}
Any help on this would be appreciated .
Martin Carpenter

*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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans