public override void FixtureSetUp() { base.FixtureSetUp(); project = WebReferenceTestHelper.CreateTestProject("C#"); WebReferencesProjectItem item = new WebReferencesProjectItem(project); item.Include = "Web References\\"; ProjectService.AddProjectItem(project, item); protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = updateFromUrl; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/test.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeProjectBindings(); webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); webReferencesProjectItem = WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences); }
public override void FixtureSetUp() { base.FixtureSetUp(); // Set up the project. MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); // Web references item. WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project); webReferencesItem.Include = "Web References\\"; ProjectService.AddProjectItem(project, webReferencesItem); // Web reference url. WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project); webReferenceUrl.Include = "http://localhost/test.asmx"; webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx"; webReferenceUrl.RelPath = "Web References\\localhost"; ProjectService.AddProjectItem(project, webReferenceUrl); FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None); discoFileItem.Include = "Web References\\localhost\\test.disco"; ProjectService.AddProjectItem(project, discoFileItem); FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None); wsdlFileItem.Include = "Web References\\localhost\\test.wsdl"; ProjectService.AddProjectItem(project, wsdlFileItem); // Proxy FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile); proxyItem.Include = "Web References\\localhost\\Reference.cs"; proxyItem.DependentUpon = "Reference.map"; ProjectService.AddProjectItem(project, proxyItem); // Reference map. FileProjectItem mapItem = new FileProjectItem(project, ItemType.None); mapItem.Include = "Web References\\localhost\\Reference.map"; ProjectService.AddProjectItem(project, mapItem); // System.Web.Services reference. ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services"); ProjectService.AddProjectItem(project, webServicesReferenceItem); // Set up the web reference. DiscoveryClientProtocol protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = "http://localhost/new.asmx"; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/new.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeProjectBindings(); var webReference = new Gui.WebReference(project, "http://localhost/new.asmx", "localhost", "ProxyNamespace", protocol); changes = webReference.GetChanges(project); }
public void SetUpFixture() { project = WebReferenceTestHelper.CreateTestProject("C#"); project.FileName = "C:\\projects\\test\\foo.csproj"; ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services"); ProjectService.AddProjectItem(project, referenceItem); protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = updateFromUrl; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/test.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeLanguageBindings(); webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference); }
public override void FixtureSetUp() { base.FixtureSetUp(); project = WebReferenceTestHelper.CreateTestProject("C#"); project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj"); protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = updateFromUrl; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/test.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeProjectBindings(); webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); foreach (ProjectItem item in webReference.Items) { ProjectService.AddProjectItem(project, item); } webReferencesProjectItem = webReference.WebReferencesProjectItem; }
public void SetUpFixture() { project = WebReferenceTestHelper.CreateTestProject("C#"); project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj"); protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = updateFromUrl; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/test.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeProjectBindings(); webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); webReferenceUrl = webReference.WebReferenceUrl; discoFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\test.disco", ItemType.None); referenceMapFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.map", ItemType.None); wsdlFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\test.wsdl", ItemType.None); proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.cs", ItemType.Compile); webReferencesProjectItem = (WebReferencesProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences); webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference); }
internal void ResolveAll(bool throwOnError) { try { base.Resolve(); } catch (Exception exception) { if (((exception is ThreadAbortException) || (exception is StackOverflowException)) || (exception is OutOfMemoryException)) { throw; } if (throwOnError) { throw; } if (Tracing.On) { Tracing.ExceptionCatch(TraceEventType.Warning, this, "ResolveAll", exception); } return; } foreach (object obj2 in this.Document.References) { DiscoveryDocumentReference reference = obj2 as DiscoveryDocumentReference; if ((reference != null) && (base.ClientProtocol.Documents[reference.Url] == null)) { reference.ClientProtocol = base.ClientProtocol; reference.ResolveAll(throwOnError); } } }
public override WebServiceDiscoveryResult Load (WebReferenceItem item) { FilePath basePath = item.MapFile.FilePath.ParentDirectory; ReferenceGroup resfile = ReferenceGroup.Read (item.MapFile.FilePath); // TODO: Read as MetadataSet DiscoveryClientProtocol protocol = new DiscoveryClientProtocol (); foreach (MetadataFile dcr in resfile.Metadata) { DiscoveryReference dr; switch (dcr.MetadataType) { case "Wsdl": dr = new System.Web.Services.Discovery.ContractReference (); break; case "Disco": dr = new System.Web.Services.Discovery.DiscoveryDocumentReference (); break; case "Schema": dr = new System.Web.Services.Discovery.SchemaReference (); break; default: continue; } dr.Url = dcr.SourceUrl; FileStream fs = new FileStream (basePath.Combine (dcr.FileName), FileMode.Open, FileAccess.Read); protocol.Documents.Add (dr.Url, dr.ReadDocument (fs)); fs.Close (); protocol.References.Add (dr.Url, dr); } return new WebServiceDiscoveryResultWCF (protocol, null, item, resfile); }
internal void ResolveAll(bool throwOnError) { try { Resolve(); } catch { if (throwOnError) { throw; } // can't continue, because we couldn't find a document. return; } foreach (object o in Document.References) { DiscoveryDocumentReference r = o as DiscoveryDocumentReference; if (r == null) { continue; } if (ClientProtocol.Documents[r.Url] != null) { continue; } r.ClientProtocol = ClientProtocol; r.ResolveAll(throwOnError); } }
private DiscoveryDocumentReference Read3_DiscoveryDocumentReference(bool isNullable, bool checkType) { XmlQualifiedName type = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if ((checkType && (type != null)) && ((type.Name != this.id20_DiscoveryDocumentReference) || (type.Namespace != this.id2_Item))) { throw base.CreateUnknownTypeException(type); } if (flag) { return null; } DiscoveryDocumentReference o = new DiscoveryDocumentReference(); bool[] flagArray = new bool[1]; while (base.Reader.MoveToNextAttribute()) { if ((!flagArray[0] && (base.Reader.LocalName == this.id16_ref)) && (base.Reader.NamespaceURI == this.id13_Item)) { o.Ref = base.Reader.Value; flagArray[0] = true; } else if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(o, ":ref"); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return o; } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int whileIterations = 0; int readerCount = base.ReaderCount; while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None)) { if (base.Reader.NodeType == XmlNodeType.Element) { base.UnknownNode(o, ""); } else { base.UnknownNode(o, ""); } base.Reader.MoveToContent(); base.CheckReaderCount(ref whileIterations, ref readerCount); } base.ReadEndElement(); return o; }
public DiscoveryDocument Discover(string url) { DiscoveryDocument document = this.Documents[url] as DiscoveryDocument; if (document != null) { return document; } DiscoveryDocumentReference reference = new DiscoveryDocumentReference(url) { ClientProtocol = this }; this.References[url] = reference; this.Errors.Clear(); return reference.Document; }
public DiscoveryDocument Discover(string url) { DiscoveryDocument document = this.Documents[url] as DiscoveryDocument; if (document != null) { return(document); } DiscoveryDocumentReference reference = new DiscoveryDocumentReference(url) { ClientProtocol = this }; this.References[url] = reference; this.Errors.Clear(); return(reference.Document); }
public DiscoveryDocument Discover(string url) { DiscoveryDocument doc = Documents[url] as DiscoveryDocument; if (doc != null) { return(doc); } DiscoveryDocumentReference docRef = new DiscoveryDocumentReference(url); docRef.ClientProtocol = this; References[url] = docRef; Errors.Clear(); // this will auto-resolve and place the document in the Documents hashtable. return(docRef.Document); }
public void SetUpFixture() { project = WebReferenceTestHelper.CreateTestProject("VBNet"); protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = updateFromUrl; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/test.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeProjectBindings(); webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.vb", ItemType.Compile); }
internal void ResolveAll(bool throwOnError) { try { Resolve(); } catch (Exception e) { if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException) { throw; } if (throwOnError) { throw; } if (Tracing.On) { Tracing.ExceptionCatch(TraceEventType.Warning, this, "ResolveAll", e); } // can't continue, because we couldn't find a document. return; } foreach (object o in Document.References) { DiscoveryDocumentReference r = o as DiscoveryDocumentReference; if (r == null) { continue; } if (ClientProtocol.Documents[r.Url] != null) { continue; } r.ClientProtocol = ClientProtocol; r.ResolveAll(throwOnError); } }
void GetFiles(string baseUrl, string relPath, string path, DiscoveryDocument doc, DynamicDiscoveryDocument ddoc) { string url = baseUrl + relPath; if (!url.EndsWith("/")) { url += "/"; } string[] files = Directory.GetFiles(path); foreach (string file in files) { string ext = Path.GetExtension(file).ToLower(); if (ext == ".asmx") { ContractReference cref = new ContractReference(); cref.DocRef = url + Path.GetFileName(file); cref.Ref = cref.DocRef + "?wsdl"; doc.References.Add(cref); } else if (ext == ".disco") { DiscoveryDocumentReference dref = new DiscoveryDocumentReference(); dref.Ref = url + Path.GetFileName(file); doc.References.Add(dref); } } string[] dirs = Directory.GetDirectories(path); foreach (string dir in dirs) { string rel = Path.Combine(relPath, Path.GetFileName(dir)); if (!ddoc.IsExcluded(rel)) { GetFiles(baseUrl, rel, Path.Combine(path, dir), doc, ddoc); } } }
public override void FixtureSetUp() { base.FixtureSetUp(); project = WebReferenceTestHelper.CreateTestProject("C#"); project.FileName = FileName.Create("C:\\Projects\\Web.csproj"); WebReferencesProjectItem item = new WebReferencesProjectItem(project); item.Include = "Web References\\"; ProjectService.AddProjectItem(project, item); protocol = new DiscoveryClientProtocol(); DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); discoveryRef.Url = updateFromUrl; protocol.References.Add(discoveryRef); ContractReference contractRef = new ContractReference(); contractRef.Url = "http://localhost/test.asmx?wsdl"; contractRef.ClientProtocol = new DiscoveryClientProtocol(); ServiceDescription desc = new ServiceDescription(); contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); protocol.References.Add(contractRef); WebReferenceTestHelper.InitializeProjectBindings(); webReference = new Gui.WebReference(project, updateFromUrl, oldName, proxyNamespace, protocol); // Force generation of items. List<ProjectItem> items = webReference.Items; // Change the web reference name. webReference.Name = name; webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl); discoFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.disco", ItemType.None); referenceMapFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.map", ItemType.None); wsdlFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.wsdl", ItemType.None); proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.cs", ItemType.Compile); }
private void Write3_DiscoveryDocumentReference(string n, string ns, DiscoveryDocumentReference o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } } else { if (!needType && !(o.GetType() == typeof(DiscoveryDocumentReference))) { throw base.CreateUnknownTypeException(o); } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("DiscoveryDocumentReference", "http://schemas.xmlsoap.org/disco/"); } base.WriteAttribute("ref", "", o.Ref); base.WriteEndElement(o); } }
public DiscoveryDocument DiscoverAny (string url) { try { string contentType = null; Stream stream = Download (ref url, ref contentType); if (contentType.IndexOf ("text/html") != -1) { // Look for an alternate url StreamReader sr = new StreamReader (stream); string str = sr.ReadToEnd (); string rex = "link\\s*rel\\s*=\\s*[\"']?alternate[\"']?\\s*"; rex += "type\\s*=\\s*[\"']?text/xml[\"']?\\s*href\\s*=\\s*(?:\"(?<1>[^\"]*)\"|'(?<1>[^']*)'|(?<1>\\S+))"; Regex rob = new Regex (rex, RegexOptions.IgnoreCase); Match m = rob.Match (str); if (!m.Success) throw new InvalidOperationException ("The HTML document does not contain Web service discovery information"); if (url.StartsWith ("/")) { Uri uri = new Uri (url); url = uri.GetLeftPart (UriPartial.Authority) + m.Groups[1]; } else { int i = url.LastIndexOf ('/'); if (i == -1) throw new InvalidOperationException ("The HTML document does not contain Web service discovery information"); Uri tmp = new Uri (url); tmp = new Uri (tmp, m.Groups [1].ToString ()); url = tmp.ToString (); } stream = Download (ref url); } XmlTextReader reader = new XmlTextReader (url, stream); reader.XmlResolver = null; reader.MoveToContent (); DiscoveryDocument doc; DiscoveryReference refe = null; if (DiscoveryDocument.CanRead (reader)) { doc = DiscoveryDocument.Read (reader); documents.Add (url, doc); refe = new DiscoveryDocumentReference (); AddDiscoReferences (doc); } #if !MONOTOUCH else if (ServiceDescription.CanRead (reader)) { ServiceDescription wsdl = ServiceDescription.Read (reader); documents.Add (url, wsdl); doc = new DiscoveryDocument (); refe = new ContractReference (); doc.References.Add (refe); refe.Url = url; ((ContractReference)refe).ResolveInternal (this, wsdl); } #endif else { XmlSchema schema = XmlSchema.Read (reader, null); documents.Add (url, schema); doc = new DiscoveryDocument (); refe = new SchemaReference (); refe.Url = url; ((SchemaReference)refe).ResolveInternal (this, schema); doc.References.Add (refe); } refe.ClientProtocol = this; refe.Url = url; references.Add (url, refe); reader.Close (); return doc; } catch (DiscoveryException ex) { throw ex.Exception; } }
public DiscoveryDocument Discover(string url) { DiscoveryDocument doc = Documents[url] as DiscoveryDocument; if (doc != null) return doc; DiscoveryDocumentReference docRef = new DiscoveryDocumentReference(url); docRef.ClientProtocol = this; References[url] = docRef; Errors.Clear(); // this will auto-resolve and place the document in the Documents hashtable. return docRef.Document; }
void GetFiles (string baseUrl, string relPath, string path, DiscoveryDocument doc, DynamicDiscoveryDocument ddoc) { string url = baseUrl + relPath; if (!url.EndsWith ("/")) url += "/"; string[] files = Directory.GetFiles (path); foreach (string file in files) { string ext = Path.GetExtension (file).ToLower(); if (ext == ".asmx") { ContractReference cref = new ContractReference (); cref.DocRef = url + Path.GetFileName (file); cref.Ref = cref.DocRef + "?wsdl"; doc.References.Add (cref); } else if (ext == ".disco") { DiscoveryDocumentReference dref = new DiscoveryDocumentReference (); dref.Ref = url + Path.GetFileName (file); doc.References.Add (dref); } } string[] dirs = Directory.GetDirectories (path); foreach (string dir in dirs) { string rel = Path.Combine (relPath, Path.GetFileName(dir)); if (!ddoc.IsExcluded (rel)) GetFiles (baseUrl, rel, Path.Combine (path, dir), doc, ddoc); } }
public DiscoveryDocument DiscoverAny(string url) { try { string contentType = null; Stream stream = Download(ref url, ref contentType); if (contentType.IndexOf("text/html") != -1) { // Look for an alternate url StreamReader sr = new StreamReader(stream); string str = sr.ReadToEnd(); string rex = "link\\s*rel\\s*=\\s*[\"']?alternate[\"']?\\s*"; rex += "type\\s*=\\s*[\"']?text/xml[\"']?\\s*href\\s*=\\s*(?:\"(?<1>[^\"]*)\"|'(?<1>[^']*)'|(?<1>\\S+))"; Regex rob = new Regex(rex, RegexOptions.IgnoreCase); Match m = rob.Match(str); if (!m.Success) { throw new InvalidOperationException("The HTML document does not contain Web service discovery information"); } if (url.StartsWith("/")) { Uri uri = new Uri(url); url = uri.GetLeftPart(UriPartial.Authority) + m.Groups[1]; } else { int i = url.LastIndexOf('/'); if (i == -1) { throw new InvalidOperationException("The HTML document does not contain Web service discovery information"); } Uri tmp = new Uri(url); tmp = new Uri(tmp, m.Groups [1].ToString()); url = tmp.ToString(); } stream = Download(ref url); } XmlTextReader reader = new XmlTextReader(url, stream); reader.XmlResolver = null; reader.MoveToContent(); DiscoveryDocument doc; DiscoveryReference refe = null; if (DiscoveryDocument.CanRead(reader)) { doc = DiscoveryDocument.Read(reader); documents.Add(url, doc); refe = new DiscoveryDocumentReference(); AddDiscoReferences(doc); } #if !MOBILE else if (ServiceDescription.CanRead(reader)) { ServiceDescription wsdl = ServiceDescription.Read(reader); documents.Add(url, wsdl); doc = new DiscoveryDocument(); refe = new ContractReference(); doc.References.Add(refe); refe.Url = url; ((ContractReference)refe).ResolveInternal(this, wsdl); } #endif else { XmlSchema schema = XmlSchema.Read(reader, null); documents.Add(url, schema); doc = new DiscoveryDocument(); refe = new SchemaReference(); refe.Url = url; ((SchemaReference)refe).ResolveInternal(this, schema); doc.References.Add(refe); } refe.ClientProtocol = this; refe.Url = url; references.Add(url, refe); reader.Close(); return(doc); } catch (DiscoveryException ex) { throw ex.Exception; } }
public override WebServiceDiscoveryResult Load (WebReferenceItem item) { FilePath basePath = item.MapFile.FilePath.ParentDirectory; ReferenceGroup resfile = ReferenceGroup.Read (item.MapFile.FilePath); // TODO: Read as MetadataSet var protocol = new DiscoveryClientProtocol (); foreach (MetadataFile dcr in resfile.Metadata) { DiscoveryReference dr; switch (dcr.MetadataType) { case "Wsdl": dr = new ContractReference (); break; case "Disco": dr = new DiscoveryDocumentReference (); break; case "Schema": dr = new SchemaReference (); break; default: continue; } dr.Url = dcr.SourceUrl; var fs = new FileStream (basePath.Combine (dcr.FileName), FileMode.Open, FileAccess.Read); protocol.Documents.Add (dr.Url, dr.ReadDocument (fs)); fs.Close (); protocol.References.Add (dr.Url, dr); } return new WebServiceDiscoveryResultWCF (protocol, null, item, resfile, DefaultClientOptions); }