Hello, here's a small patch for the implementation
of the serialization support (implements ISerializable) for
System.Net.WebProxy.
I attach the xml obtained when you serialize a WebProxy with MS .Net
(for name compatibility)
Best regards mono:: team.
(feedback welcome)
cesar
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:WebProxy id="ref-1"
xmlns:a1="http://schemas.microsoft.com/clr/nsassem/System.Net/System%2C%20Version%3D1.0.3300.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089">
<_BypassOnLocal>true</_BypassOnLocal>
<_ProxyAddress href="#ref-3"/>
<_BypassList xsi:type="xsd:anyType" xsi:null="1"/>
</a1:WebProxy>
<a2:Uri id="ref-3"
xmlns:a2="http://schemas.microsoft.com/clr/nsassem/System/System%2C%20Version%3D1.0.3300.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089">
<AbsoluteUri id="ref-4">http://address/</AbsoluteUri>
</a2:Uri>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Index: WebProxy.cs
===================================================================
RCS file: /mono/mcs/class/System/System.Net/WebProxy.cs,v
retrieving revision 1.3
diff -u -r1.3 WebProxy.cs
--- WebProxy.cs 21 May 2002 15:56:21 -0000 1.3
+++ WebProxy.cs 12 Aug 2002 20:26:29 -0000
@@ -62,10 +62,15 @@
CheckBypassList ();
}
- [MonoTODO]
+
protected WebProxy (SerializationInfo serializationInfo,
StreamingContext streamingContext)
{
- throw new NotImplementedException ();
+ if (serializationInfo == null)
+ throw new ArgumentNullException ();
+
+ BypassProxyOnLocal = serializationInfo.GetBoolean
+("_BypassOnLocal");
+ Address = (System.Uri) serializationInfo.GetValue
+("_ProxyAddress", typeof (Uri));
+ BypassList = (string []) serializationInfo.GetValue
+("_BypassList", typeof (string []));
}
// Properties
@@ -163,11 +168,13 @@
}
}
- [MonoTODO]
+
void ISerializable.GetObjectData (SerializationInfo serializationInfo,
StreamingContext streamingContext)
{
- throw new NotImplementedException ();
+ serializationInfo.AddValue ("_BypassOnLocal",
+BypassProxyOnLocal);
+ serializationInfo.AddValue ("_ProxyAddress", Address, typeof
+(Uri));
+ serializationInfo.AddValue ("_BypassList", BypassList, typeof
+(string []));
}
// Private Methods
@@ -191,4 +198,4 @@
return new Uri (address);
}
}
-}
\ No newline at end of file
+}