-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while try excecute update_object and save_changes #14
Comments
Which part gives you a 400 error, the query portion of the update? |
result2 = svc.save_changes, in this line |
Try using the develop branch of ruby_odata. I added some basic error handling so you should be able to see the cause of your 400 error. It should spit out a more useful message (pulled from the error xml returned from the OData service) when the exception is thrown. Let me know what you find... |
Dude, look this is my error with the develop branch, i can not understand this: 2012-05-16T13:26:55+00:00 app[web.1]: RuntimeError - HTTP Error 400: Only 'If-Match' headers are supported for Update/Delete operations.: i whan update a deatil table with a master. my table has a foreign key |
Is your OData Service using etags? I think it's a problem with concurrency management (scroll down to the section Concurrency Management here http://msdn.microsoft.com/en-us/library/ff798339.aspx). I'm not doing anything with passing etags around, so my guess is that the entity you are trying to update doesn't match the current entity. |
yes, i think this is the problem merge concurrency, with the etags. |
Hi -
Im not sure how to do either on the odata service object. Here is my code: svc_vm = OData::Service.new "https://server:8090/SC2012R2/vmm/Microsoft.Management.Odata.svc/", {:verify_ssl => false, :username => "user", :password => "password", :namespace => "VMM"} svc_vm.VirtualMachines.Filter("Name eq 'LinuxVM'") thanks in advance for any help. |
I haven't added support for etags, because I'm not sure how to set them up for an OData service. If you can figure it out and could supply sample data of returned results (edmx, and query results), then it should be something that ruby_odata could support. |
@jdcrackdon - Do you have some some sample code? i'm really stuck with this... |
Hi dude i have this code
svc = OData::Service.new "http://dev.idlinksolutions.com/clicktoaction/clicktoactionData.svc/" , { :username => "xxxxxxxxx", :password=> "xxxxxx" }
svc.FanPages.filter("PageId eq '#{settings.fan_page_id}'")
fan_page = svc.execute.first
fan_page.Token = 'aaa'
svc.update_object(fan_page)
result2 = svc.save_changes
p result2.inspect
But, this say Bad request 400 error
The text was updated successfully, but these errors were encountered: