Results 1 to 4 of 4

Thread: Calling RESTful webservice

  1. #1

    Exclamation Calling RESTful webservice

    I am sure this is already in the forum.. I am just not able to find a solution yet..

    I am trying to call a RESTful webservice across domain. I keep getting an error code.

    I would be greatful if somebody can point me in the right direction.

    If NOT across domain, atleast within the same domain would be helpful...

    The following code does not seem to work...

    		 url: 'http://<URL>/services/businessunitcombo',
    		 waitMsg: "Sending Request...",
    		 method: 'POST',
    		 success: function(response, opts){alert('Must have been 2xx http status code');},
    		 failure: function(response, opts){alert('Must have been 4xx or a 5xx http status code:' + response.status);}

  2. #2
    Sencha User joseeight's Avatar
    Join Date
    Sep 2010
    New York, NY


    You can't make an AJAX call cross domain, you must set up a proxy to do that. Here is what I used, got it a long time ago to solve the problem.

    PHP Code:
    // Set content type here
    header('Content-type: text/xml');

    //Request URL

    //Getting data from URL requested
    $handle fopen($requestURL"r");

    if ($handle) {
        while (!
    feof($handle)) {
    $buffer fgets($handle4096);
    You call this page on the same server with the parameters you need to send to the regular service. It will return the same data you would get as making the same direct call.

  3. #3


    Thank you Jose.. Will try this out...

  4. #4


    I got it working by calling a servlet which I am comfy with.. Works like a charm...

    Donna head or tail of PHP

    Thanks a bunch mate

Similar Threads

  1. calling java webservice using AJAX object
    By ramasekhar in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 27 Apr 2011, 10:35 PM
  2. [ExtJS 3.3] Calling webservice with parameters in ASP.NET
    By --miCZar-- in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 5 Nov 2010, 6:10 AM
  3. Extjs to call a RESTful webservice
    By vivekc in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 1 Dec 2009, 10:55 PM
  4. problem calling a webservice in webMethods environment
    By brikonwall in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 12 Feb 2008, 7:23 AM
  5. Error when calling a webservice
    By graphicsxp in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 27 Dec 2007, 11:57 AM

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