Training
Module
Work with XMLports in Dynamics 365 Business Central - Training
Learn how to define and use XMLports in AL, understand different nodes and properties, and apply them in AL code.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The XML Schema Definition tool (Xsd.exe) allows you to generate an XML schema that describes a class or to generate the class defined by an XML schema. The following procedures show how to perform these operations.
The XML Schema Definition tool (Xsd.exe) usually can be found in the following path:
C:\Program Files (x86)\Microsoft SDKs\Windows\{version}\bin\NETFX {version} Tools\
Open a command prompt.
Pass the XML Schema as an argument to the XML Schema Definition tool, which creates a set of classes that are precisely matched to the XML Schema, for example:
xsd mySchema.xsd /classes
(The /classes
option in this command is used to generate classes for the mySchema
schema.)
The tool can only process schemas that reference the World Wide Web Consortium XML specification of March 16, 2001. In other words, the XML Schema namespace must be "http://www.w3.org/2001/XMLSchema"
, as shown in the following example.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
Modify the classes with methods, properties, or fields, as necessary. For more information about modifying a class with attributes, see Controlling XML Serialization Using Attributes and Attributes That Control Encoded SOAP Serialization.
It is often useful to examine the schema of the XML stream that is generated when instances of a class (or classes) are serialized. For example, you might publish your schema for others to use, or you might compare it to a schema with which you are trying to achieve conformity.
Compile the class or classes into a DLL.
Open a command prompt.
Pass the DLL as an argument to Xsd.exe, for example:
xsd MyFile.dll
The schema (or schemas) will be written, beginning with the name "schema0.xsd".
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Training
Module
Work with XMLports in Dynamics 365 Business Central - Training
Learn how to define and use XMLports in AL, understand different nodes and properties, and apply them in AL code.