Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 524703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:35:44+00:00 2026-05-13T08:35:44+00:00

All, I’m working on a Flash application that’s supposed to send XML data to

  • 0

All,

I’m working on a Flash application that’s supposed to send XML data to a Java Servlet.

I’m responsible for the Flash app; another team is responsible for the Java Servlet.

The problem we’re having is that I’m familiar with Flash but not Java and Servlets; the other team is expert in Java and Servlets, but unfamiliar with Flash.

Anyway, I have some AS2 code that uses sendAndLoad() to send XML data to a server.

It works great when I send it to PHP, or ASP, or ASP.net (stuff I’m familiar with).

However, the Java team is having trouble receiving the information with their servlet.

One of the developers sent me a log entry:

GET /portal/delegate/ParticipantService?svc=someServiceName&XMLStr=[the encoded xml I sent] 

As I understand it, xml.sendAndLoad uses POST, not GET, so I don’t understand why this shows up in the log as a GET. Any ideas or explanation?

Also, any suggestions about what to tell the developers about how to receive the XML?

Obviously, it’s possible that the issue is with my Actionscript code, but as I said, it works if I send it to a PHP page, where I pick it up with something like this:

$doc = new DomDocument();
$doc->loadXML(file_get_contents("php://input"));

UPDATE:

Here’s what an Adobe Technote says about this:

When loadVariables or getURL actions are
used to send data to Java servlets it
can appear that the data is being sent
using a GET request, when the POST
method was specified in the Flash
movie.

This happens because Flash sends the
data in a GET/POST hybrid format. If
the data were being sent using a GET
request, the variables would appear in
a query string appended to the end of
the URL. Flash uses a GET server
request, but the Name/Value pairs
containing the variables are sent in a
second transmission using POST.
Although this causes the servlet to
trigger the doGet() method, the
variables are still available in the
server request.

So, I guess what I need to know is how to tell the Java team to look for and capture the XML that’s been sent…

Many thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:35:44+00:00Added an answer on May 13, 2026 at 8:35 am

    Flash is doing something really weird. It may not be illegal but it’s very unconventional. Servlet doesn’t expect this for sure. It includes a message body in GET request. Basically, it’s doing a POST with GET. Servlet ignores message body for GET.

    To handle this, Java servlet has to process the message body. It’s not hard to do. Just read the InputStream and convert it into a string. It’s in x-www-urlencoded format.

    Here is the code I use to parse it,

    byte[] buffer = new byte[4096];
    InputStream is = request.getInputStream();
    ByteArrayOutputStrem os = new ByteArrayOutputStream();
    
    for (int read = is.read(buffer); read > 0; read = is.read(buffer)) {
        os.write(buffer, 0, read);
    }
    
    is.close();
    os.close();
    
    String queryString = os.toString("utf-8");
    
    ...
    
           Map<String, String> map = new TreeMap<String, String>();
    
            if (queryString == null)
                    return map;
    
            // Split at & and ignore space/newline at the ends
            String pairs[] = queryString.split("[&\\s]");
    
            for (String pair : pairs) {
                int pos = pair.indexOf('=');
                String key;
                String value;
                try {
                        if (pos == -1) {
                            key = URLDecoder.decode(pair, "UTF-8");
                            value = null;
                        } else {
                                            key = URLDecoder.decode(pair.substring(0, pos), "UTF-8");
                                    value = URLDecoder.decode(pair.substring(pos+1, pair.length()), "UTF-8");
                                    }
                } catch (UnsupportedEncodingException e) {
                                            // All JRE has UTF-8
                                    throw new IllegalStateException("No UTF-8");
                            }
                map.put(key, value);
            }
    
            return map;
    

    map contains the parameters included in the message body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 447k
  • Answers 447k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Google Analytics javascript runs when you load a page.… May 15, 2026 at 7:29 pm
  • Editorial Team
    Editorial Team added an answer A stateful object doesn't imply IDisposable is required. The real… May 15, 2026 at 7:29 pm
  • Editorial Team
    Editorial Team added an answer Here's an example of a chatroom using node.js, source code… May 15, 2026 at 7:29 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.