I guess I should have clarified as well.
My thoughts are to see if the flash ".send(" will send your XML data
in just a POST format.
I am thinking that because ".sendAndLoad" uses a GET/POST hybrid
(this probably because you use sendAndLoad if you want a response to
what your submitting),
try using ".send(" or find out if ".send(" uses just the POST method
(because your not expecting a response, there is no reason for the
hybrid?).
Sorry, I haven't looked up if this is the case, just more a though to
go off of. If it is the case,
then you should be able to send your data in a POST method, that
which is required by your Java team.
HTH
Karl
On Dec 16, 2009, at 7:11 AM, matt stuehler wrote:
Karl,
Many thanks for your response!
However, I should clarify...
I guess what I'm really looking for is some instructions for the Java
Servlet team, on how to capture the XML sent by Flash.
In other words, here's what I've said:
Me: "Team - I will POST an XML document to the URL you've provided"
Them: "We're not seeing the XML. In fact, if we check our log, it
looks like you're using GET, not POST"
Me: "I'm not sure why that's the case. According to the Adobe/Flash
documentation xml.sendAndLoad ALWAYS uses POST"
That's when I discovered the Adobe Technote that clarifies that "Flash
sends the data in a GET/POST 'hybrid' format", whatever that means.
Flash is apparently doing something a little unorthodox.
So, even though I don't know Java - I'm hoping someone on this forum
knows both Flash and something about Java Servlets, and can give me a
pointer about catching the XML properly in the servlet. Once the Java
team "gets" the XML, they'll be able to parse it and proceed from
there.
For example, in PHP, here's how you'd catch the XML sent from Flash:
$doc = new DomDocument();
$doc->loadXML(file_get_contents("php://input"));
Is there an equivalent method for a Java Servlet that account for the
somewhat strange way Flash POSTs the XML data?
Cheers,
Matt
On Wed, Dec 16, 2009 at 3:48 AM, Karl DeSaulniers
<k...@designdrumm.com> wrote:
Maybe try just send. Unless you need a response sent back to your
flash
file.
Karl
Sent from losPhone
On Dec 16, 2009, at 2:34 AM, matt stuehler
<stuehler.t...@gmail.com> wrote:
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?
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.
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"));
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!
Cheers,
Matt Stuehler
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders