Ejemplo n.º 1
0
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<CommentServiceSoapClient>(session).GetComment(
         input.ReadString(),
         input.ReadString(),
         input.ReadInt32());
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<PhotoServiceSoapClient>(session).GetPhotosForCollection(
         input.ReadString(),
         input.ReadString(),
         input.ReadInt32());
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     HttpProcessor.GetClient<MemberServiceSoapClient>(session).SetMemberStatusText(
         input.ReadString(),
         input.ReadString(),
         input.ReadString());
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     HttpProcessor.GetClient<AskServiceSoapClient>(session).CompleteQuestion(
        input.ReadString(),
        input.ReadString(),
        input.ReadString());
 }
Ejemplo n.º 5
0
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<TagServiceSoapClient>(session).UploadTags(
         input.ReadString(),
         input.ReadString(),
         input.ReadTagUpdate());
 }
Ejemplo n.º 6
0
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<DashboardServiceSoapClient>(session).GetThumbnail(
         input.ReadString(),
         input.ReadString(),
         input.ReadString());
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     HttpProcessor.GetClient<SnapUpServiceSoapClient>(session).DeviceUploadPhoto(
         input.ReadString(),
         input.ReadString(),
         Convert.ToBase64String(input.ReadByteArray()),
         input.ReadDateTime().Ticks.ToString());
 }
Ejemplo n.º 8
0
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     HttpProcessor.GetClient<AskServiceSoapClient>(session).AttachPhoto(
        input.ReadString(),
        input.ReadString(),
        input.ReadString(),
        input.ReadInt32(),
        Convert.ToBase64String(input.ReadByteArray()));
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<AskServiceSoapClient>(session).SubmitQuestion(
         input.ReadString(),
         input.ReadString(),
         input.ReadString(),
         input.ReadInt32(),
         input.ReadInt32(),
         input.ReadStringArray(),
         input.ReadInt32(),
         input.ReadBoolean());
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     HttpProcessor.GetClient<MemberServiceSoapClient>(session).RemindPassword(
         input.ReadString());
 }
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<AskServiceSoapClient>(session).GetQuestionIDs(
         input.ReadString(),
         input.ReadString());
 }
Ejemplo n.º 12
0
 public void Invoke(HttpSessionState session, DataInputStream input)
 {
     _result = HttpProcessor.GetClient<MemberServiceSoapClient>(session).GetTagID(
         input.ReadString(),
         input.ReadString());
 }
Ejemplo n.º 13
0
 private static void InvokeMethod(HttpSessionState session, Int32 requestID, DataInputStream input, DataOutputStream output)
 {
     _methods[requestID].Invoke(session, input);
     output.WriteInt16(HttpProcessor.RESULT_SUCCESSFUL);
     _methods[requestID].Return(output);
 }
Ejemplo n.º 14
0
        private static void ProcessPostRequest(HttpRequest request, HttpResponse response, HttpSessionState session)
        {
            response.ContentType = "application/octet-stream";

            var memoryStream = new MemoryStream();
            var output = new DataOutputStream(memoryStream);

            try
            {
                var input = new DataInputStream(request.InputStream);
                var version = request.Headers["version"];
                if (version != null)
                {
                    if (!HttpProcessor.PROTOCOL_VERSION.Equals(version, StringComparison.Ordinal))
                        throw new IOException(String.Format(
                            CultureInfo.CurrentCulture,
                            Resources.IO_InvalidProtocolVersion,
                            version,
                            HttpProcessor.PROTOCOL_VERSION));
                }

                if (input.ReadInt16() == HttpProcessor.INVOCATION_CODE)
                    InvokeMethod(session, input.ReadInt32(), input, output);
                input.Close();
            }
            catch (Exception e)
            {
                if (output == null)
                    output = new DataOutputStream(response.OutputStream);

                output.WriteInt16(HttpProcessor.RESULT_EXCEPTION);
                Debug.WriteLine(e.StackTrace);
                output.WriteString(e.ToString());
            }

            response.SetContentLength(memoryStream.Length);

            try
            {  
                var data = new Byte[memoryStream.Length];
                memoryStream.Seek(0, SeekOrigin.Begin);
                memoryStream.Read(data, 0, data.Length);
                response.OutputStream.Write(data, 0, data.Length);
            }
            finally
            {
                if (output != null)
                    output.Close();
                response.OutputStream.Close();
            }
        }