A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Problem in sending data to rest services from flex.

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    2

    Problem in sending data to rest services from flex.

    Hello Everybody,
    I am working on an application in which I have to call rest services in the backend from Adobe Air UI in the front end, using as3 httpclient. Now, while calling these services I have to pass the data of a text file as an argument to that rest service.
    What I have found is that, when I try to call the service by passing the data of a small text file, it works. But when I try to call the rest service by passing a huge data as an argument of a very big text file, it doesn't even reach till the service back end. It gives a warning of bad http request (error code 400) and also gives an security sandbox violation error inspite of putting cross doman xml file in the server root folder.
    So I wanted to ask whether there is any restriction on the data size that can be passed to backend from as3 httpclient object to rest services.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Are you using a GET request? Servers often limit the maximum size of a GET request. Try changing over to POST.

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    2
    Sorry, I forgot to mention that. It is POST request. I convert, actionscript model object which has to be passed as an argument to the service, into XML form and then I convert that XML into byte array using ByteArray class. Then I call post function of the httpclient class with 3 arguments i.e uri, byte array data and contenttype.

    post(uri, byteArrayData, contentType)

    here, contentType is "application/xml" and uri is the url of the rest service.

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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center