ServiceStack.Host.XsdMetadata.GetReplyOperationNames C# (CSharp) Méthode

GetReplyOperationNames() public méthode

public GetReplyOperationNames ( Format format, HashSet soapTypes ) : List
format Format
soapTypes HashSet
Résultat List
        public List<string> GetReplyOperationNames(Format format, HashSet<Type> soapTypes)
        {
            return Metadata.OperationsMap.Values
                .Where(x => HostContext.Config != null
                    && HostContext.MetadataPagesConfig.CanAccess(format, x.Name))
                .Where(x => !x.IsOneWay)
                .Where(x => soapTypes.Contains(x.RequestType))
                .Select(x => x.RequestType.GetOperationName())
                .ToList();
        }

Usage Example

        public WsdlTemplateBase GetWsdlTemplate(XsdMetadata operations, string baseUri, bool optimizeForFlash, string rawUrl, string serviceName)
        {
            var xsd = new XsdGenerator
            {
                OperationTypes = operations.GetAllTypes(),
                OptimizeForFlash = optimizeForFlash,
            }.ToString();

            var soapFormat = GetType().Name.StartsWith("Soap11", StringComparison.OrdinalIgnoreCase)
                ? Format.Soap11 : Format.Soap12;

            var wsdlTemplate = GetWsdlTemplate();
            wsdlTemplate.Xsd = xsd;
            wsdlTemplate.ServiceName = serviceName;
            wsdlTemplate.ReplyOperationNames = operations.GetReplyOperationNames(soapFormat);
            wsdlTemplate.OneWayOperationNames = operations.GetOneWayOperationNames(soapFormat);

            if (rawUrl.ToLower().StartsWith(baseUri))
            {
                wsdlTemplate.ReplyEndpointUri = rawUrl;
                wsdlTemplate.OneWayEndpointUri = rawUrl;
            }
            else
            {
                var suffix = soapFormat == Format.Soap11 ? "soap11" : "soap12";
                wsdlTemplate.ReplyEndpointUri = baseUri + suffix;
                wsdlTemplate.OneWayEndpointUri = baseUri + suffix;
            }

            return wsdlTemplate;
        }
All Usage Examples Of ServiceStack.Host.XsdMetadata::GetReplyOperationNames