Creating components via rest, parentComponentID needs to be NULL...
Hi,
I'm trying to use the rest API to create a component on a project.
When I check the components in Gemini they exist but don't appear on any of the UI features apart from the admin screen.
When I checked the database I noticed their parentComponentID was 0 (if I pass 0) and not NULL like the rest. If I edit the component in the gemini admin and just update without changing anything the record in the database switches to NULL instead of 0 and then appears on all the front ends.
I've tried passing 'NULL' and '0' but they just store '0' in the field; I tried leaving that node empty in the xml so it was just [ParentComponentID][/ParentComponentID] but that generates the following error:
[?xml version="1.0" encoding="utf-8"?][RestError xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"][Exception][InnerMessage]Object reference not set to an instance of an object.[/InnerMessage][InnerSource]CounterSoft.Gemini.Presenter[/InnerSource][InnerStack] at CounterSoft.Gemini.Presenter.ProjectPresenter.CreateComponent(ComponentEN data) at CounterSoft.Gemini.Web.Api.ProjectsRestHandler.ComponentCreate(RequestDetails rd)[/InnerStack][InnerType]System.NullReferenceException[/InnerType][Message]Exception has been thrown by the target of an invocation.[/Message][Source]mscorlib[/Source][Stack] at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at CounterSoft.Gemini.Web.Api.x984df3e201a5cc4a.xd8c6760a50aeba18(RequestDetails x4f7dd955f6bfaf92, MethodInfo x2a154456227d18a2)[/Stack][Type]System.Reflection.TargetInvocationException[/Type][/Exception][Message]Exception has been thrown by the target of an invocation.[/Message][Type]InternalServerError[/Type][/RestError]
If I leave the XML node out entirely it defaults to using 0! Am I just going about this in the wrong way??
light2
· 1 |
|
Monday, November 2, 2009, 1:46:49 PM |