Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Because a SOAP message is built using XML, the XmlSerializer class can be used to serialize classes and generate encoded SOAP messages. The resulting XML conforms to section 5 of the World Wide Web Consortium document "Simple Object Access Protocol (SOAP) 1.1". When you are creating an XML Web service that communicates through SOAP messages, you can customize the XML stream by applying a set of special SOAP attributes to classes and members of classes. For a list of attributes, see Attributes That Control Encoded SOAP Serialization.
Create the class using the XML Schema Definition Tool (Xsd.exe).
Apply one or more of the special attributes found in System.Xml.Serialization
. See the list in "Attributes That Control Encoded SOAP Serialization."
Create an XmlTypeMapping
by creating a new SoapReflectionImporter
, and invoking the ImportTypeMapping
method with the type of the serialized class.
The following code example calls the ImportTypeMapping
method of the SoapReflectionImporter
class to create an XmlTypeMapping
.
' Serializes a class named Group as a SOAP message.
Dim myTypeMapping As XmlTypeMapping =
New SoapReflectionImporter().ImportTypeMapping(GetType(Group))
// Serializes a class named Group as a SOAP message.
XmlTypeMapping myTypeMapping =
new SoapReflectionImporter().ImportTypeMapping(typeof(Group));
Create an instance of the XmlSerializer
class by passing the XmlTypeMapping
to the XmlSerializer(XmlTypeMapping) constructor.
Dim mySerializer As XmlSerializer = New XmlSerializer(myTypeMapping)
XmlSerializer mySerializer = new XmlSerializer(myTypeMapping);
Call the Serialize
or Deserialize
method.
' Serializes a class named Group as a SOAP message.
Dim myTypeMapping As XmlTypeMapping =
New SoapReflectionImporter().ImportTypeMapping(GetType(Group))
Dim mySerializer As XmlSerializer = New XmlSerializer(myTypeMapping)
// Serializes a class named Group as a SOAP message.
XmlTypeMapping myTypeMapping =
new SoapReflectionImporter().ImportTypeMapping(typeof(Group));
XmlSerializer mySerializer = new XmlSerializer(myTypeMapping);
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Work with web services in Dynamics 365 Business Central - Training
Use SOAP and OData to read and update records, and handle UI interaction in Business Central.