O
Ollie
I have defined a set of SOAP messages using an xsd file, each element in the
xsd has the minoccurs, maxoccurs & nillable attributes defined when I then
use xsd.exe to generation C# classes for these message the attributes are
NOT defined for the class members - e.g.
<xsd:complexType name="Session">
<xsd:sequence>
<xsd:element name="Id" type="xsd:int" nillable="false" minOccurs="1"
maxOccurs="1" />
<xsd:element name="Name" type="xsd:string" nillable="false"
minOccurs="1" maxOccurs="1" />
<xsd:element name="StartDate" type="xsd:date" nillable="false"
minOccurs="1" maxOccurs="1" />
<xsd:element name="EndDate" type="xsd:date" nillable="false"
minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
when the C# class is generated it appears as:
[System.Xml.Serialization.XmlTypeAttribute(Namespace="uk.org.XXX.esm.v1")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="uk.org.XXX.esm.v1",
IsNullable=false)]
public class Session
{
/// <remarks/>
public int Id;
/// <remarks/>
public string Name;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="date")]
public System.DateTime StartDate;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="date")]
public System.DateTime EndDate;
}
Can I mark the class members as having minoccurs, maxoccurs & nillable
attributes or is this impossible?
Is it possible to make a WS end point not accept a null value(message)? - if
so will it throw a SOAP exception?
If I go the contract first way of development for the WS do I have to
manually create the WSDL file after creating the xsd ?
Anyone know of a good tool for generating the WSDL with the attributes I
want....
Cheers in advance
Ollie
xsd has the minoccurs, maxoccurs & nillable attributes defined when I then
use xsd.exe to generation C# classes for these message the attributes are
NOT defined for the class members - e.g.
<xsd:complexType name="Session">
<xsd:sequence>
<xsd:element name="Id" type="xsd:int" nillable="false" minOccurs="1"
maxOccurs="1" />
<xsd:element name="Name" type="xsd:string" nillable="false"
minOccurs="1" maxOccurs="1" />
<xsd:element name="StartDate" type="xsd:date" nillable="false"
minOccurs="1" maxOccurs="1" />
<xsd:element name="EndDate" type="xsd:date" nillable="false"
minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
when the C# class is generated it appears as:
[System.Xml.Serialization.XmlTypeAttribute(Namespace="uk.org.XXX.esm.v1")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="uk.org.XXX.esm.v1",
IsNullable=false)]
public class Session
{
/// <remarks/>
public int Id;
/// <remarks/>
public string Name;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="date")]
public System.DateTime StartDate;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="date")]
public System.DateTime EndDate;
}
Can I mark the class members as having minoccurs, maxoccurs & nillable
attributes or is this impossible?
Is it possible to make a WS end point not accept a null value(message)? - if
so will it throw a SOAP exception?
If I go the contract first way of development for the WS do I have to
manually create the WSDL file after creating the xsd ?
Anyone know of a good tool for generating the WSDL with the attributes I
want....
Cheers in advance
Ollie