2 // Microsoft.Web.Services.Addressing
4 // Author: Todd Berman <tberman@gentoo.org>
6 // (C) 2003 Todd Berman
10 using Microsoft
.Web
.Services
.Xml
;
12 namespace Microsoft
.Web
.Services
.Addressing
15 public abstract class EndpointReferenceType
: OpenElement
18 private Address _address
;
19 private PortType _portType
;
20 private ReferenceProperties _properties
;
21 private ServiceName _serviceName
;
23 public EndpointReferenceType (Uri address
) : base ()
26 throw new ArgumentNullException ("address");
28 _address
= new Address (address
);
31 public EndpointReferenceType (Address address
) : base ()
34 throw new ArgumentNullException ("address");
39 public EndpointReferenceType () : base ()
43 protected override void GetXmlAny (XmlDocument document
, XmlElement element
)
45 if(document
== null) {
46 throw new ArgumentNullException ("document");
49 throw new ArgumentNullException ("element");
52 element
.AppendChild (_address
.GetXml (document
));
54 if(_portType
!= null) {
55 element
.AppendChild (_portType
.GetXml (document
));
58 if(_properties
!= null) {
59 element
.AppendChild (_properties
.GetXml (document
));
62 if(_serviceName
!= null) {
63 element
.AppendChild (_serviceName
.GetXml (document
));
66 base.GetXmlAny (document
, element
);
69 protected override void LoadXmlAny (XmlElement element
)
72 throw new ArgumentNullException ("element");
75 foreach (XmlAttribute attrib
in element
.Attributes
) {
76 AnyAttributes
.Add (attrib
);
79 foreach (XmlElement node
in element
.ChildNodes
) {
80 if(node
.NamespaceURI
!= "http://schemas.xmlsoap.org/ws/2003/03/addressing") {
83 switch (node
.LocalName
) {
85 _address
= new Address (node
);
87 case "ReferenceProperties":
88 _properties
= new ReferenceProperties (node
);
91 _portType
= new PortType (node
);
94 _serviceName
= new ServiceName (node
);
98 AnyElements
.Add (node
);
102 public Address Address
{
103 get { return _address; }
106 throw new ArgumentNullException ("Address");
112 public PortType PortType
{
113 get { return _portType; }
114 set { _portType = value; }
117 public ReferenceProperties ReferenceProperties
{
118 get { return _properties; }
119 set { _properties = value; }
122 public ServiceName ServiceName
{
123 get { return _serviceName; }
124 set { _serviceName = value; }