Exemple #1
0
 static string GetOperationName(Uri address, IDispatchOperationSelector operationSelector)
 {
     Message message = Message.CreateMessage(MessageVersion.None, "");
     message.Headers.To = address;
     HttpRequestMessageProperty messageProperty = new HttpRequestMessageProperty();
     messageProperty.Method = "GET";
     message.Properties.Add(HttpRequestMessageProperty.Name, messageProperty);
     return operationSelector.SelectOperation(ref message);
 }
Exemple #2
0
        static string  GetOperationName(Uri address, IDispatchOperationSelector operationSelector)
        {
            Message message = Message.CreateMessage(MessageVersion.None, "");

            message.Headers.To = address;
            HttpRequestMessageProperty messageProperty = new HttpRequestMessageProperty();

            messageProperty.Method = "GET";
            message.Properties.Add(HttpRequestMessageProperty.Name, messageProperty);
            return(operationSelector.SelectOperation(ref message));
        }
Exemple #3
0
            public DispatchOperationRuntime GetOperation(ref Message request)
            {
                string operationName = _selector.SelectOperation(ref request);

                if (_map.TryGetValue(operationName, out DispatchOperationRuntime operation))
                {
                    return(operation);
                }
                else
                {
                    return(_unhandled);
                }
            }
Exemple #4
0
        public string SelectOperation(ref Message message)
        {
            HttpRequestMessageProperty httpRequest = message.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;

            if (httpRequest != null)
            {
                string methodName = httpRequest.Headers[COSNT_HEADER_METHOD];
                if (!string.IsNullOrEmpty(methodName) && httpRequest.Method.ToLower() != methodName.ToLower())
                {
                    httpRequest.Method = methodName;
                }
            }

            //return new WebHttpDispatchOperationSelector(m_Endpoint).SelectOperation(ref message);
            return(m_Operation.SelectOperation(ref message));
        }