简体   繁体   中英

RIA Services: cannot insert or update entity

Good day!

In our project we are using .NET RIA Services and Linq2Sql. To insert/update entity we've implemented some custom logic. On server side was written a method which call 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.

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!

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? (ie, the address bar in the app is NOT 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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