/// <summary>Processes the specified request.</summary> /// <param name="request">The request to process.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The response to the specified request.</returns> protected override Task <Types.Capabilities> ProcessRequestAsync(Types.GetCapabilities request, CancellationToken cancellationToken) { // When sections is specified but empty, the abbreviated version of GetCapabilities should be returned // cf. [OGC CITE TEAMEngine csw:csw-2.0.2-GetCapabilities-tc7.1] bool returnAll = ((request.Content.Sections == null) || request.Content.Sections.Section.Contains("All")); var ret = new Types.Capabilities(); ret.Untyped.Add( new XAttribute(XNamespace.Xmlns + CreateUniquePrefix(Namespaces.OgcOws, ret.Untyped, "ows"), Namespaces.OgcOws) ); ret.Filter_Capabilities = CreateFilterCapabilitiesSection(); if (returnAll || (request.Content.Sections.Section.Contains("OperationsMetadata"))) { Ows100.OperationsMetadata om = CreateOperationsMetadataSection(); if (om != null) { ret.Untyped.Add( new XAttribute(XNamespace.Xmlns + CreateUniquePrefix(Namespaces.XLinkNamespace, ret.Untyped, "xl"), Namespaces.XLinkNamespace) ); ret.Content.OperationsMetadata = om; } } if (returnAll || (request.Content.Sections.Section.Contains("ServiceProvider"))) { string xl = ret.Untyped.GetPrefixOfNamespace(Namespaces.XLinkNamespace); if (string.IsNullOrEmpty(xl)) { ret.Untyped.Add( new XAttribute(XNamespace.Xmlns + CreateUniquePrefix(Namespaces.XLinkNamespace, ret.Untyped, "xl"), Namespaces.XLinkNamespace) ); } ret.Content.ServiceProvider = CreateServiceProviderSection(); } if (returnAll || (request.Content.Sections.Section.Contains("ServiceIdentification"))) { ret.Content.ServiceIdentification = CreateServiceIdentificationSection(); } ret.Content.version = Version; return(Task.FromResult(ret)); }
public XRootNamespace(OperationsMetadata root) { this.doc=new XDocument(root.Untyped); this.rootObject=root; }