Exemplo n.º 1
0
        object WaitForTerminalStatusOrTimeout(long instanceId, string planUniqueName, string path, SerializationType serializationType,
                                              int pollingIntervalSeconds, int timeoutSeconds, bool setContentType)
        {
            object result = SyncExecuteHelper.WaitForTerminalStatusOrTimeout(
                this, planUniqueName, instanceId, path, serializationType, pollingIntervalSeconds, timeoutSeconds);

            if (setContentType)
            {
                return(GetHttpResponse(result, serializationType));
            }
            else
            {
                return(result);
            }
        }
Exemplo n.º 2
0
        object WaitForTerminalStatusOrTimeout(long instanceId, string planUniqueName, string path, SerializationType serializationType,
                                              int pollingIntervalSeconds, int timeoutSeconds, bool setContentType)
        {
            object result = SyncExecuteHelper.WaitForTerminalStatusOrTimeout(
                this, planUniqueName, instanceId, path, serializationType, pollingIntervalSeconds, timeoutSeconds);

            if (setContentType)
            {
                Encoding encoding = serializationType == SerializationType.Xml ? Encoding.Unicode : Encoding.UTF8;
                netHttp.HttpResponseMessage response = new netHttp.HttpResponseMessage(System.Net.HttpStatusCode.OK);
                response.Content = new netHttp.StringContent(GetStringContent(result, serializationType),
                                                             encoding, SerializationContentType.GetContentType(serializationType));
                return(response);
            }
            else
            {
                return(result);
            }
        }