www.rollbase.com/rest/api/createApplicationDef?sessionId=123343&xmlString='<application xml below>'
When trying to perform a createApplicationDef call using the REST API service (with Administrator Privileges), I am getting an error:
<err>Cannot parse XML document</err>
I am using the standard Application Definition XML example provided in the documentation:
<Application id="7558" origId="7558" orderNo="3" isSystem="false" version="1"
<!-- List of Objects -->
Any suggestions on how I can fixed this error or what is wrong with my API call?
Please pass sessionId as URL parameter. It will work. Please find attached screenshot.
createApplicationDef is REST Post API call . Please pass xml file as input instead of xmlstring to API.
PostMethod post = new PostMethod(url);
int result = httpclient.executeMethod(post);
I have exported an app as an XML using the generate XML option and I am trying to create that application again using the createApplicationDef, however now I am getting an error:
Error processing field name: no "uiClass" attribute
In Application xml file please check any field has attribute uiClass. if there Please change that attribute to "uiClassName".
I am not sure why you get uiClass attribute when exported application as xml file. When i exported here getting "uiClassName" attribute.
I get uiClassName attribute as well when I export application as an xml file but when I run the api call, it gives me the error that there is no uiClass attribute which is correct. What does the createApplicationDef expect?
Can you please share application xml file. So that i can look into what value is getting for uiClassName attribute.
Ex: In my case i am getting uiClassName for Email Field is
<DataFieldDef id="9490" origId="5865" objDef="9483" columnName="STR5" fieldName="email" groupName="CONTACT" dataClassName="com.rb.core.data.definition.FieldString" uiClassName="com.rb.core.ui.web.field.EmailInput" isRequired="false" isReadOnly="false" isTextIndexable="false" isSystem="false" isAuditable="false" hasPermissions="false" maxLength="50" >
That's correct. I get the same for my email field. Likewise I get the correct uiClassName for my other fields as well but as per the error if I'm not mistaken, its looking for uiClass and not uiClassName, correct?
Yes. When we create Fields alone also we need to give uiClass instead of uiClassName . Please change and try it.
I have changed and tried it and now I'm getting an error:
"Object Definition 1234 not found"
<DataObjectDef id="1234" origId="1234" objDefName="iKAppObject1" isSystem="false" isAuditable="false" isViewable="false" isFlaggable="false" isDependent="false" isDeployed="true">
I already have the object defined in my XML and its still showing this error. Any suggestions why?
I also realized that the API is creating applications as and when I call the createApplicationDef API even if it has errors. Is there a way I could stop it from creating applications if there are errors because its difficult to keep undeploying and deleting them (as it requires an hour between the two actions)? KIndly let me know.
By using "install" REST API also we can install application xml files. It will install successfully . No modifications needed.
Is there a function called "install" in REST API that would do this? Could you provide me with a reference, link or an example please?
Here is documenation link for install API. Please pass xml file as body for POST Method.
I am trying to do what you suggested, now I am getting some other error. I am using an Application called: SOAPUI to test the API call and am attaching a screenshot of the result that I am getting back from the request.
Any suggestions on where I am going wrong now?
Amazing. That works brilliantly! Thanks.