The WSIT Tutorial


Guideline: Use Leach-Salz variant of UUID at runtime.

java.util.UUID maps to schema type xs:string. .NET maps xs:string to System.string. The constructors in java.util.UUID allow any variant of UUID to be created. Its methods are for manipulation of the Leach-Salz variant.

Example: Mapping UUID

//-- Java code fragment
public class ReportUid {
    public java.util.UUID uuid;

//-- Schema fragment
<xs:complexType name="reportUid">
        <xs:element name="uuid" type="xs:string" minOccurs="0"/>

//-- .NET auto generated code from schema
public partial class reportUid: object,
    private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
    private string uuidField;

    public System.Runtime.Serialization.ExtensionDataObject ExtensionData
        get { return this.extensionDataField; }
        set { this.extensionDataField = value; }

    public string uuid
        get { return this.uuidField; }
        set { this.uuidField = value; }

//-- C# code fragment
reportUid tmpU = new reportUid();
System.Guid guid = new System.Guid("06b7857a-05d8-4c14-b7fa-822e2aa6053f");
tmpU.uuid = guid.ToString();