Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTD is prohibited in this XML document #19

Open
vascofernandes opened this issue Jun 21, 2022 · 3 comments
Open

DTD is prohibited in this XML document #19

vascofernandes opened this issue Jun 21, 2022 · 3 comments

Comments

@vascofernandes
Copy link

Hi,

Thanks for the cool library.

Sometimes I get the following error message:

"For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method. "

With this stack trace:

System.Xml.XmlException:
   at System.Xml.XmlTextReaderImpl.Throw (System.Private.Xml, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl (System.Private.Xml, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent (System.Private.Xml, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Xml.XmlReader.MoveToContent (System.Private.Xml, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.ServiceModel.Channels.StreamedMessage..ctor (System.Private.ServiceModel, Version=4.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.ServiceModel.Channels.Message.CreateMessage (System.Private.ServiceModel, Version=4.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at Data8.PowerPlatform.Dataverse.Client.ADAuthClient.Execute (Data8.PowerPlatform.Dataverse.Client, Version=2.1.1.0, Culture=neutral, PublicKeyToken=null)
   at Data8.PowerPlatform.Dataverse.Client.ADAuthClient.RetrieveMultiple (Data8.PowerPlatform.Dataverse.Client, Version=2.1.1.0, Culture=neutral, PublicKeyToken=null)
   at Data8.PowerPlatform.Dataverse.Client.OnPremiseClient.RetrieveMultiple (Data8.PowerPlatform.Dataverse.Client, Version=2.1.1.0, Culture=neutral, PublicKeyToken=null)
   at MyCrmApi.Extensions.OrganizationServiceExtensions.RetrieveMultipleComplete (Crmp.Kverneland.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

Could this https://stackoverflow.com/a/28459398 be relevant?

Regards

@MarkMpn
Copy link
Contributor

MarkMpn commented Jun 22, 2022

Thanks for the details. Can you reproduce this error with specific requests? Would you be able to capture a Fiddler trace of the request & response so I can see the best way of fixing this?

@yogster
Copy link

yogster commented Mar 22, 2023

I had this issue and found it was due to the service returning an HTML error page, containing a DTD in the first line.

@akaskela
Copy link

akaskela commented Nov 4, 2024

I just reproduced this error accidentally. When I specified the On Prem URL I had just the server name, not the "XRMServices/2011/Organization.svc" path. Once I corrected this it was fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants