Ejemplo n.º 1
0
        public HttpResponseMessage ReadPublicationMessage(string sessionId)
        {
            HttpStatusCode statusCode      = HttpStatusCode.OK;
            string         reasonPhrase    = "";
            string         responseContent = "";

            ISBMHandler myISBMHandler = new ISBMHandler();

            myISBMHandler.ReadPublicationMessage(sessionId, ref responseContent, ref statusCode, ref reasonPhrase);

            HttpResponseMessage response = new HttpResponseMessage(statusCode);

            response.ReasonPhrase = reasonPhrase;
            response.Content      = new StringContent(responseContent, Encoding.UTF8, "application/json");

            return(response);
        }
        public HttpResponseMessage DeleteChannel(string channelId)
        {
            HttpStatusCode statusCode      = HttpStatusCode.OK;
            string         reasonPhrase    = "";
            string         responseContent = "";

            // Create a new ISBMHandler
            ISBMHandler myISBMHandler = new ISBMHandler();

            // Use DeleteChannel method
            myISBMHandler.DeleteChannel(channelId, ref responseContent, ref statusCode, ref reasonPhrase);

            HttpResponseMessage response = new HttpResponseMessage(statusCode);

            response.ReasonPhrase = reasonPhrase;
            response.Content      = new StringContent(responseContent, Encoding.UTF8, "application/json");

            return(response);
        }
Ejemplo n.º 3
0
        public HttpResponseMessage PostPublicationMessage(string sessionId, [FromBody] JObject bodBody)
        {
            string body = bodBody.ToString(Formatting.None);

            HttpStatusCode statusCode      = HttpStatusCode.OK;
            string         reasonPhrase    = "";
            string         responseContent = "";

            ISBMHandler myISBMHandler = new ISBMHandler();

            myISBMHandler.PostPublicationMessage(sessionId, body, ref responseContent, ref statusCode, ref reasonPhrase);

            HttpResponseMessage response = new HttpResponseMessage(statusCode);

            response.ReasonPhrase = reasonPhrase;
            response.Content      = new StringContent(responseContent, Encoding.UTF8, "application/json");

            return(response);
        }
        public HttpResponseMessage CreateChannel([FromBody] JObject bodBody)
        {
            // Get HTTP request content
            string body = bodBody.ToString(Formatting.None);

            HttpStatusCode statusCode      = HttpStatusCode.OK;
            string         reasonPhrase    = "";
            string         responseContent = "";

            // Create a new ISBMHandler
            ISBMHandler myISBMHandler = new ISBMHandler();

            // Use CreateChannel method
            myISBMHandler.CreateChannel(body, ref responseContent, ref statusCode, ref reasonPhrase);

            HttpResponseMessage response = new HttpResponseMessage(statusCode);

            response.ReasonPhrase = reasonPhrase;
            response.Content      = new StringContent(responseContent, Encoding.UTF8, "application/json");

            return(response);
        }
        public HttpResponseMessage OpenProviderPublicationSession(string channelId)
        {
            // Get HTTP request content
            // string body = request.Content.ReadAsStringAsync().Result;

            HttpStatusCode statusCode      = HttpStatusCode.OK;
            string         reasonPhrase    = "";
            string         responseContent = "";

            // Create a new ISBMHandler
            ISBMHandler myISBMHandler = new ISBMHandler();

            // Use OpenProviderPublicationSession method
            myISBMHandler.OpenProviderPublicationSession(channelId, ref responseContent, ref statusCode, ref reasonPhrase);

            HttpResponseMessage response = new HttpResponseMessage(statusCode);

            response.ReasonPhrase = reasonPhrase;
            response.Content      = new StringContent(responseContent, Encoding.UTF8, "application/json");

            return(response);
        }