1. #1
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    27
    Vote Rating
    0
    crgrah is on a distinguished road

      0  

    Default Unanswered: ASAP: WCF service wrapper issues related to d: ?

    Unanswered: ASAP: WCF service wrapper issues related to d: ?


    I have the following code call to a wcf service that works

    Code:
    var me = this;
    
    Ext.Ajax.request({
        headers: {
            'Content-Type': 'application/json; charset=utf-8'
        },
        method: 'GET',
        url: 'Service.svc/Login',
        params: {
            userName: Ext.ComponentQuery.query('#UserNameTextField')[0].getValue(),
            passWord: Ext.ComponentQuery.query('#PasswordPasswordField')[0].getValue()
        },
        success: function (response) {
            me.goToClientPage();
        },
        failure: function (response) {
            var text = response.responseText;
            Ext.Msg.alert('Failure', 'Password and/or Username are invalid values, ' + text);
        }
    });
    the json response that it recognises is as follows
    {
    • d: false
    }

    however i have a store configured to retrieve data where all the values
    returned are null,

    Service.svc/GetClientsByUserID in the ajax proxy
    the json returned is as follows


    {
    • d:
      [

      • {
        • __type: "FAC_Client:#DataContext",
        • Archived: false,
        • Country: "australia",
        • DOB: "/Date(473346000000+1100)/",
        • FAC_ClientID: 1,
        • FAC_Relatives: [ ],
        },

        etc
        .
        .


        I have read some code that references the d wrapper as follows:

        Ext.Ajax.request( { url: 'ws/ServiceName.asmx/NotifyApprove', method: 'post', headers: { 'Content-Type': 'application/json;charset=utf-8' }, jsonData: jsonData, success: function(response, options) { response = eval('results = ' + response.responseText); var sequenceId = parseInt(response.d.SequenceId); //The response is wrapped in d //do something if you need }, failure: function(response, options) { response = eval('results = ' + response.responseText); } });

    How do i remove the d wrapper from sencha touch 2 generated code?this is an urgent production issue..I would appreciate a working example.cheers
    Last edited by mitchellsimoens; 2 Apr 2012 at 7:33 AM. Reason: added [CODE] tags

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    Answers
    3102
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You want to map your store to JSON that has a root of 'd'?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    27
    Vote Rating
    0
    crgrah is on a distinguished road

      0  

    Default What do you mean? Is it not clear my question?

    What do you mean? Is it not clear my question?


    How do i do that? Show me code?

  4. #4
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    27
    Vote Rating
    0
    crgrah is on a distinguished road

      0  

    Default the answer is to set the rootproperty to d for anyone else with this issue

    the answer is to set the rootproperty to d for anyone else with this issue


    mark as answered