示例#1
0
    /// <summary>
    /// Return Type, Paramater 받아서 Xml, Json, String으로 결과값 반환
    /// </summary>
    /// <param name="serviceInfo"></param>
    /// <returns>결과값</returns>
    private string ConvertMessageType(UdtServiceInfo serviceInfo, List <Dictionary <string, string> > arrDicResult)
    {
        string        sResult   = "지원하지 않는 반환 형식입니다.";
        List <string> arrResult = new List <string>();

        if (serviceInfo.ReturnType.Equals("JSON"))
        {
            for (int i = 0; i < arrDicResult.Count; i++)
            {
                arrResult.Add(TypeParser.DictionaryToJson(arrDicResult[i]));
            }

            sResult = TypeParser.ListToJson(arrResult);
        }
        else if (serviceInfo.ReturnType.Equals("XML"))
        {
            for (int i = 0; i < arrDicResult.Count; i++)
            {
                arrResult.Add(TypeParser.DictionaryToXml(arrDicResult[i]));
            }

            sResult = TypeParser.ListToXml(arrResult);
        }
        else
        {
            sResult = "지원하지 않는 반환 형식입니다.";
        }



        return(sResult);
    }