AnsweredAssumed Answered

Alfresco.util.Ajax.jsonGet results in a 'not well-formed' exception

Question asked by mario.fliegner on Oct 10, 2014
Latest reply on Jan 29, 2015 by staifresco
Hi all,

I'm struggling with a webscript, that I'm calling inside a custom form control to retrieve values for a dropdown. I don't get the response parsed at all. The reason may be that the browser's error console says that the result is not well-formed!?

Here is the JacaScript code, that invokes the webscript:
function selectArchiveId(currentValueHtmlId) {
                        this.currentValueHtmlId = currentValueHtmlId;
                        var selectArchiveId = Dom.get(this.currentValueHtmlId);
                        this.register = function () {

                                url: Alfresco.constants.PROXY_URI + "my/company/feature/getArchiveIds",
                                successCallback: {
                                    fn: function(res) {
                                        var results = Alfresco.util.parseJSON(res.serverResponse.responseText);
                                    scope: this,

                                failureCallback: {
                                    fn: function () {
                                    scope: this
                        }; //this.register


The alert pops up with content:

[object Object]

But I can't access it. The content is always null or undefined. The code above is based on this topic:

The response from the webscript is:

{"archiveIds":{"K1":"NSP System","Z1":"PEI System","Q1":"KKK Dev System","Q2":"KKK Dev System","Z3":"PEI System","Z2":"PEI System"}}

Something is returned…
The error message from the browser is attached as image.
I think it's related to the function used for the webscript call: Alfresco.util.Ajax.jsonGet ?
But if I try to call the webscript by the Alfresco.util.Ajax.GET function, then this function is not found.

If you are interested in the webscript definition itself:

    <shortname>Get Dropdown values</shortname>
        Get all dropdown values for archiveId
    <format default="json"/>
    <family>my company</family>

How do I call the webscript correctly? Or how I'm able to access the response? Does anybody know?