web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Wizard generated Document Service XML schema invalid

(0) ShareShare
ReportReport
Posted on by

I created a number of tables, 3 children under a parent, wrote a query, generated a document service, wrote C# to call it, and tested it.  All works.  I wanted to write some unit tests (nUnit) using the XML response as input to the tests using XML Spy to generate sample XML files.  So I captured the WSDL and all the dependent .xsd(s).  I made all the paths relative and loaded the top level element of the response into XMLSpy.  When it generated the sample, was truncated with no data and just the DocPurpose and SenderId elements.  Confused, I reviewed the schemas.  The name of the top level element and the name of the element entities it contained were the same, in the same namespace, assigned different complex types.  That did not seem right, so for giggles, I adjusted the schema adding a "P" (for Parent) to the parent element's name.  I asked XML Spy to generate a sample XML file, which it did perfectly.

Dynamics AX has not given me any violations of best practices.  No errors.  It isn't clear to me from what source the Parent element's name is derived.  Is this normal for Dynamics AX 2009?  Is there a way to have it generate a different name?  This seems like a bug, yet the C# WCF code generated (svcutil.exe) from the AX WSDL has no trouble unmarshalling the XML.  Yet when using the C# System.Xml.Serialization.XmlSerializer to unmarshal the test XML data into the C# WCF generated class, it fails with an InvalidOperationException, "There is an error in the XML document(4,2)".  Thoughts?  Suggestions?  It seemed like a great way to initialize the test response data.  Thank you.

Fred

*This post is locked for comments

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans