简体   繁体   English

RIA服务:无法插入或更新实体

[英]RIA Services: cannot insert or update entity

Good day! 美好的一天!

In our project we are using .NET RIA Services and Linq2Sql. 在我们的项目中,我们使用.NET RIA服务和Linq2Sql。 To insert/update entity we've implemented some custom logic. 为了插入/更新实体,我们实现了一些自定义逻辑。 On server side was written a method which call sp. 在服务器端编写了一个调用sp的方法。 The problem is that our method don't invoked because it can not be found! 问题是我们的方法没有被调用,因为找不到它!

Implemented method on server side: 服务器端的实现方法:

public void InsertNewPolicy(Policy policy)
{
    int userId = 111;
    int? policyId = -1;
    policyId = this.Context.cast_Policy_Insert(ref policyId, null, policy.PolicyNumber, policy.PolicyEffectiveDate,
                                    policy.PolicyExpirationDate, policy.ModifiedUserId, policy.PrimaryInsuranceCompanyID,
                                    policy.IssuingInsuranceCompanyID, null, null, policy.PolicyTypeID, null,
                                    null, "", null, "", null, "", null, null, null, userId);
}

Class witch contains this method marked with EnableClientAccess attribute. 女巫类包含带有EnableClientAccess属性标记的此方法。

On client side we call this method as: 在客户端,我们将此方法称为:

CASTDomainContext context = new CASTDomainContext();
context.Policies.Add(EditablePolicy);
context.SubmitChanges();

But when run this, operaton fails with 404 error code and says that resource with URL CASTSilverlight/ClientBin/DataService.axd/CASTSilverlight-Web-CASTDomainService/$Submit cannot be found! 但是运行此命令时,操作失败并显示404错误代码,并指出找不到 URL URL CASTSilverlight / ClientBin / DataService.axd / CASTSilverlight-Web-CASTDomainService / $ Submit的资源

Please, help to solve this problem. 请帮助解决此问题。

Thanks. 谢谢。

feugenix -- to rule out some of the general common errors with services (and the NotFound error), are you running the Silverlight application under an HTTP context? feugenix-为了排除服务中的一些常见常见错误(以及NotFound错误),您是否在HTTP上下文下运行Silverlight应用程序? (ie, the address bar in the app is NOT c:\\something?) (即,应用程序中的地址栏不是c:\\ something吗?)

I usually recommend using a tool to sniff the traffic and really see what the response is from the server. 我通常建议使用一种工具来监听流量,并真正查看来自服务器的响应。 http://timheuer.com/blog/archive/2008/06/10/silverlight-services-cross-domain-404-not-found.aspx http://timheuer.com/blog/archive/2008/06/10/silverlight-services-cross-domain-404-not-found.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM