Beispiel #1
0
        public Uri CreateUri(ESBContext context)
        {
            UriBuilder builder = new UriBuilder(Uri)
            {
                Path  = context.Attributes(ESBContants.URL_PATH_OUT_KEY),
                Query = context.QueryString
            };

            return(builder.Uri);
        }
Beispiel #2
0
        public bool Validate(ESBContext context, string[] paths)
        {
            if (PathList.Length != paths.Length)
            {
                return(false);
            }

            StringBuilder sb = new StringBuilder();

            if (!context.Method.Equals(Method))
            {
                return(false);
            }

            for (int i = 0; i < PathList.Length; i++)
            {
                string pReq    = paths[i];
                string pSource = PathList[i];

                if (pSource.StartsWith("{", StringComparison.CurrentCulture) &&
                    pSource.EndsWith("}", StringComparison.CurrentCulture))
                {
                    sb.Append("/").Append(pReq);

                    continue;
                }

                if (!pReq.Equals(pSource))
                {
                    return(false);
                }

                sb.Append("/").Append(pReq);
            }

            context.Attributes(ESBContants.URL_PATH_OUT_KEY, sb.ToString());


            return(true);
        }