Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,421
    Vote Rating
    1271
      0  

    Default

    Look at the network tab in the developer tools in your browser
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •