using System.Diagnostics;\r
using System.Runtime.CompilerServices;\r
using System.Web.Services.Description;\r
+using System.Web.Services.Discovery;\r
using System.Xml.Serialization;\r
using System.Xml.Schema;\r
using System.Collections;\r
}\r
}\r
\r
- [MonoTODO]\r
public void Discover ()\r
{\r
- throw new NotImplementedException ();\r
+ BindingInfo bnd = (BindingInfo) type_info.Bindings [0];\r
+ \r
+ DiscoveryClientProtocol discoverer = new DiscoveryClientProtocol ();\r
+ discoverer.Discover (Url);\r
+ \r
+ foreach (object info in discoverer.AdditionalInformation)\r
+ {\r
+ System.Web.Services.Discovery.SoapBinding sb = info as System.Web.Services.Discovery.SoapBinding;\r
+ if (sb != null && sb.Binding.Name == bnd.Name && sb.Binding.Namespace == bnd.Namespace) {\r
+ Url = sb.Address;\r
+ return;\r
+ }\r
+ }\r
+ \r
+ string msg = string.Format ("The binding named '{0}' from namespace '{1}' was not found in the discovery document at '{2}'", bnd.Name, bnd.Namespace, Url);\r
+ throw new Exception (msg);\r
}\r
\r
protected override WebRequest GetWebRequest (Uri uri)\r
"Content is not 'text/xml' but '" + response.ContentType + "'",
response, encoding);
\r
+ message.ContentType = ctype;\r
+ message.ContentEncoding = encoding.WebName;\r
+ \r
Stream stream = response.GetResponseStream ();\r
\r
if (extensions != null) {\r