Exemple #1
0
        /// <summary>
        /// Sends the data to be echo'd to the service bus
        /// </summary>
        /// <param name="request">The data to be echo'd</param>
        /// <returns>The response from the servicebus</returns>
        public static ServiceBusResponse echoAsIs(AsIsEchoRequest request)
        {
            ServiceBusConnection tempConnection = new ServiceBusConnection("");
            ServiceBusResponse   response       = tempConnection.echoAsIs(request);

            tempConnection.close();
            return(response);
        }
Exemple #2
0
        /// <summary>
        /// Publishes an EchoEvent.
        /// </summary>
        /// <param name="request">The data to be echo'd back to the client</param>
        /// <returns>The data sent by the client</returns>
        private ServiceBusResponse asIsEcho(AsIsEchoRequest request)
        {
            AsIsEchoEvent echoEvent = new AsIsEchoEvent
            {
                data     = request.data,
                username = username
            };

            //This function publishes the EchoEvent class. All endpoint instances that subscribed to these events prior
            //to the event being published will have their respictive handler functions called with the EchoEvent object
            //as one of the parameters
            eventPublishingEndpoint.Publish(echoEvent);
            return(new ServiceBusResponse(true, request.data));
        }
Exemple #3
0
        /// <summary>
        /// This function is called by the client on the users computer when they request an asisecho
        /// </summary>
        /// <param name="asIsText">The text to be sent to the service bus</param>
        /// <returns>An html page containing the response from the service bus</returns>
        public ActionResult AsIsEcho(string asIsText)
        {
            AsIsEchoRequest      request = new AsIsEchoRequest(asIsText);
            ServiceBusResponse   response;
            ServiceBusConnection connection = ConnectionManager.getConnectionObject(Globals.getUser());

            if (connection == null)
            {
                response = ConnectionManager.echoAsIs(request);
            }
            else
            {
                response = connection.echoAsIs(request);
            }

            ViewBag.AsIsResponse = response.response;

            return(View("Index"));
        }
Exemple #4
0
 /// <summary>
 /// Sends the data to be echo'd to the service bus
 /// </summary>
 /// <param name="request">The data to be echo'd</param>
 /// <returns>The response from the servicebus</returns>
 public ServiceBusResponse echoAsIs(AsIsEchoRequest request)
 {
     send(request);
     return(readUntilEOF());
 }