Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ServiceContract]
- public interface IShapeTest
- {
- [OperationContract]
- AbsShape EchoShape(AbsShape shape);
- }
- public class ShapeTestImpl : IShapeTest
- {
- public AbsShape EchoShape(AbsShape shape)
- {
- return shape;
- }
- }
- [KnownType(typeof(Square))]
- public abstract class AbsShape
- {
- [DataMember]
- public int numSides;
- }
- public class Square : AbsShape
- {
- public Square() : base()
- {
- numSides = 4;//set the numSides to 'prove' it works
- }
- }
- <xs:complexType name="AbsShape" abstract="true"> <!--NOTE abstract="true"-->
- <xs:sequence>
- <xs:element minOccurs="0" name="numSides" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="AbsShape"> <!--NOTE the lack of abstract="true"-->
- <xs:sequence>
- <xs:element minOccurs="0" name="numSides" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
Add Comment
Please, Sign In to add comment