Closed chzhcpu closed 8 years ago
@chzhcpu Maybe your user's permissions are insufficient. Anyhow I'll investigate and let you know ASAP
Thinks for your kind replay. Would you please give me an example of create or update a node?
@chzhcpu Your code looks quite fine, but I think there's some issue with the XmlRpcStruct class. Please try these: 1) To update the node, do not assign a new value to its fields but remove and add them back like this:
var node = service.NodeRetrieve(1);
var oldTitle = node["title"];
node.Remove("title");
node["title"] = oldTitle + " (UPDATED)";
node = service.NodeUpdate(Convert.ToInt32(node["nid"]), node);
2) You can "clone" a node like this (at first i thought it was necessary to remove the "nid", in fact it is not):
var node = service.NodeRetrieve(1);
var clone = service.NodeCreate(node);
You can combine 1) and 2) of course:
var node = service.NodeRetrieve(1);
node.Remove("title");
node["title"] = "This is a clone";
var clone = service.NodeCreate(node);
By the way, remember to check that your user has update and create permissions, and that the node you are retrieving actually exists.
Update: "cloning" a node was in fact easier than i thought, I just updated the comment above accordingly.
Thanks a lot. It works well.
I have the same access denied issue, my site is accessed as anonymous even after sucessful login (see the other issue I created)
Correction - if I DO NOT login I can access nodes.
When I AM LOGGED IN, I can't.
It also does not make any difference if I tick the session authentication in services config or not.
The access denied issue is resolved on my end (human error).
I have logged in and creatnode , but throw a exception: access deny: here is my code: