如何使用存储过程的WCF服务发布大量数据? [英] How to post huge data using WCF service with stored procedure?

查看:96
本文介绍了如何使用存储过程的WCF服务发布大量数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我使用存储过程创建了一个WCF服务。

Hello,

I have created a WCF service using stored procedure.

[WebGet]
        public List<View_JobAssign> AssignJobs(string employeeId, string assignDate, string jobs, string userId)
        {
            try
            {
                TrackerEntities entities = new TrackerEntities();
                return entities.AssignJobs(Convert.ToDateTime(assignDate), Convert.ToInt32(employeeId), jobs, Convert.ToInt32(userId)).ToList();

            }
            catch (Exception ex)
            {
                throw new DataServiceException(ex.Message + ex.InnerException);
            }
        }





我传递给上述服务的数据是

employeeId = 1,assignDate =2017-02-22,Jobs =1,2,3,userid = 1

,它就像魅力一样。

但是问题是当我尝试传递Jobs ='1,2,.... 10000',即高达10000,这使得一个长字符串然后我得到HTTP请求失败错误。



如何使用长数据将数据传递给存储过程创建的服务?

还有其他选择吗?



什么我试过了:



我试图在实体框架中使用反射提供程序,但它不起作用。



The data which I pass to above service is
employeeId = 1, assignDate = "2017-02-22", Jobs="1,2,3", userid = 1
and it works like charm.
But the problem is when I try to pass Jobs = '1,2,....10000' i.e upto 10000 which makes a long string then I get HTTP request Failed Error.

How do I pass data to stored procedure created service with long data?
is there any alternative?

What I have tried:

I tried to use reflection provider with Entity Framework but it doesn't work.

推荐答案

正如理查德所说,你需要搜索谷歌以获得你所得到的确切错误,因为你可以根据超出的限制改变设置。



然而,对我来说,更明显的建议是减少你一次发送的数量和j ust循环发送较小的数量。
As Richard mentioned you would need to search google for the exact error you are getting because there are settings you can change depending on what limit you are exceeding.

However, to me, the more obvious suggestion is to cut down on how many you send at once and just loop to send smaller amounts.


这篇关于如何使用存储过程的WCF服务发布大量数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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