Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Xml param not reaching the Server when declared in transformRequest

    Hi, I am doing this

    isc.DataSource.create({
    ID:"SomeDS",
    dataFormat:"xml",
    dataProtocol: "postParams",
    dataURL:"/doc/security/docAuthorizedActions.action",
    recordXPath:"//content",
    fields:{
    docName:{title:"Document", type:"text", name:"name"},
    docIndex:{title:"Index", type:"text", name:"index"},
    lastModified:{title:"Last Modified", type:"text", name:"lastmodified"}
    },
    showPrompt:false,
    fetchData: function( criteria, callback, requestProperties ) {
    progressIndicator.show();
    progressIndicator.bringToFront();
    var ret = this.Super("fetchData", arguments);
    progressIndicator.hide();
    },
    transformRequest: function(dsRequest) {
    var secureURL = "http://www.some.com/doc/security/";
    var xmlStr1 = "<docSecurity:docAuthorizedActionsRequest xmlns:documentSecurity=secureURL><wId><%= request.getParameter("wId") %></wId></docSecurity:docAuthorizedActionsRequest>";

    var params = { xml : xmlStr1 };
    return isc.addProperties({}, dsRequest.data, params);
    }
    });


    This works when I use it as a GET Request ie., Specify the xml param in the dataURL. but when using transformRequest and declaring dataProtocol: "postParams", I get an error saying expecting xml param not received...

    Thankyou

    #2
    Hi Stem

    Try adding the following line to your transformRequest function:

    Code:
    dsRequest.contentType = "application/x-www-form-urlencoded; charset=UTF-8";
    This workaround was required for another user who reported a similar issue with his server ignoring data posted by SmartClient.

    Comment

    Working...
    X