需要Web服务的代码,该代码接受arraylist或hashmap并将值插入数据库. [英] Need code for webservice which accepts the arraylist or hashmap and insert the values into database.

查看:75
本文介绍了需要Web服务的代码,该代码接受arraylist或hashmap并将值插入数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要有关编写Web服务代码的帮助. Web服务分为三层-Web服务,业务逻辑和DAL.我需要接受数组列表并对其进行处理的逻辑.并在业务逻辑中使用它,然后将值插入数据库.由于我是Web服务的新手,所以我没有确切的解决方案.我认为散列图可能是解决方案,但不是很确定.

UI以以下格式发送数据:

Hi,

I need help for writing the code for the webservice. The webservice is divided in three layer - Webservice, Business Logic and DAL. I need the logic for accepting the array list and process it. And use it in the business logic and then insert the values into the database. As i am new to the webservice i am not getting the exact solution. I think hash map may be the solution but not very sure.

The UI sends the data in the following format :

event102 =     {
        Slot1 =         {
            Capacity = 56;
            SlotDayCount = 1;
            SlotDesc = fdsf;
            SlotLocation = fdsfds;
            SlotName = fds;
            SlotType = Private;
            TimeFrom = "00:01";
            TimeTo = "00:01";
            TrackNo = 2;
        };
        Slot2 =         {
            Capacity = 56;
            SlotDayCount = 1;
            SlotDesc = fdsf;
            SlotLocation = fdsf;
            SlotName = dsf;
            SlotType = Public;
            TimeFrom = "00:06";
            TimeTo = "08:00";
            TrackNo = 2;
        };
    };
}




在此先感谢............




Thanks in advance............

推荐答案

您正在以JSON对象的形式获取响应.您需要对它进行反序列化..
请参阅此链接

在ASP.NET 3.5中使用JSON [ ^ ]

http://stackoverflow.com/questions/10433551/problems-sending-and-receiving-json-between-asp-net-web-service-and-asp-net-web [
You are getting the response as a JSON object. You need to deserelize it..
Refer this links

Using JSON with ASP.NET 3.5[^]

http://stackoverflow.com/questions/10433551/problems-sending-and-receiving-json-between-asp-net-web-service-and-asp-net-web[^]


这篇关于需要Web服务的代码,该代码接受arraylist或hashmap并将值插入数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆