1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
    roravec is on a distinguished road

      0  

    Default Help Sending Information to a WCF REST Service and Handling the Respone

    Help Sending Information to a WCF REST Service and Handling the Respone


    Hi,

    I am brand new with ExtJS.

    I currently have a basic Login form that is supposed to send username and password information to a WCF service that checks the information and returns a custom message object in Json with the format {"success":true , "token": "token_string"}. success is a bool and token is a string in C#.

    I know the WCF service works as intended because sending a POST method to the url at which the service is hosted with the appropriate Json message using Fiddler returns the desired output.

    However, attempting to submit the information via an Ext Form Submit, it always returns as a failure. In addition, I have the form attempt to output the accept.result, and it always shows up as undefined.

    Here is the code for my button click event:

    Code:
    onButtonClick: function(button, e, options) {
    if(this.getForm().isValid()){ this.getForm().submit({ method: 'POST', url: 'url_of_the_service', success: function(form, action) { Ext.Msg.alert('Login Successful!'); }, failure: function(form, action) { Ext.Msg.alert('Login Failure!'+action.result); } }); }
    }
    My main question is: Is there anyway I can see the request this form is sending to the url, using fiddler or other means to see if it is being sent correctly? Also, I want to display the "token" property returned in the Ext.Msg.alert, just to see if everything works correctly. How would I go about doing that?

    Thanks for your time.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Look at the network tab in the developer tools in your browser
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

Thread Participants: 1

Tags for this Thread