Esempio n. 1
0
        private ExpoMessageOutput callService(uint appClassId, uint commandId, ExpoMessageInput request)
        {
            request.RequestMessageId = Guid.NewGuid().ToString();

            var header = new CommandHeader(request.UserId, appClassId, commandId);

            object[] retValues = null;
            bool     isSuccess = _proxy.DoCommandProxy(header, request.BuidExpoMessageBody(), out retValues);

            if (isSuccess)
            {
                var response = new ExpoMessageOutput(retValues);
                return(response);
            }
            else
            {
                throw new Exception("unknow error!");
            }
        }
Esempio n. 2
0
        private void getScriptHandler(HttpContext context, string requestContent)
        {
            var input = new ExpoMessageInput
            {
                UserId = 0,
                ServiceAssemblyName   = "wind.iSeller.serviceBus.zero",
                ServiceCommandName    = "getAllScriptProxyCommand",
                RequestMessageContent = "{}"
            };

            ExpoMessageOutput response = this.callService(this.TargetAppClassId, this.TargetCommandId, input);

            if (response.ResponseCode == SUCCESS_RESPONSE_CODE)
            {
                string script = (((JObject)JsonConvert.DeserializeObject(response.ResponseContent)).GetValue("ScriptContent")).ToString();

                context.Response.ContentType = "application/javascript";
                context.Response.Charset     = "UTF-8";
                context.Response.Write(script);
            }
        }