  | | | ::[FSdesigners]:: FlashRemoting w/FlashMX2004 and EJB... really working? | ::[FSdesigners]:: FlashRemoting w/FlashMX2004 and EJB... really working? 2004-04-19 - By KingKarsten
Back I do have serious problems. For quite a long time I am trying to connect some Enterprise JavaBeans to a FlashMovie. The idea was to combine a great FrontEnd and a great BackEnd.
The problem is, I can't get it work. I bought a copy of FlashMX2004 and installed the RemotingComponents (from http://www.macromedia.com/software/flashremoting/downloads/components ). I wrote Enterprise JavaBeans that work well, they are deployed on a JBoss Server and a TestServlet shows me, that everything is okay and acts (answers) like it should. I searched the web and got quite litte information (EJB seems to be not too popular with FlashRemoting) and about none concerning FlashMX2004. I deployed the Gateway and can connect to it.
In a looong list of errors I fought my way through the very little delved and barely penetrable jungle to what I call my final frontier. When I run my move, I get connected to my EJB (Home Interface with getService(myJNDI)) and even get an object when calling myEJB.create(). But when I try doing anything with that, Flash does nothing. No request, no answer, the NetConnection Debugger shows neither call nor answer. I try to call the makeSomeNoise() Method which should give a simple String back.
Sorry for telling my whole story, but I'm quite frustrated by now.
Any suggestion for emprovement strongly appreciated! However, here is my code...
FRAME1: #include "NetServices.as" #include "NetDebug.as"
var myURL:String = "http://localhost:8080/flashgateway/gateway"; var myEJB:String = "ejb/foo/facade/Entry";
var textCon:String = new String(); var createRes:Object = new Object();
_global.System.onStatus = createRes.onStatus;
EJBtext.text = "soon...";
// connection stuff function init() { // Gateway NetServices.setDefaultGatewayUrl(myURL); var myGateway:Object = NetServices.createGatewayConnection(); // BeanInstance EntryBean = myGateway.getService(myEJB); if (EntryBean != null) { textCon = "Connection Established\nEntryBean:" + EntryBean; EntryBean.create(createRes); } else { EJBtext.text = "Cannot connect to server."; } }
createRes.onResult = function (resData:Object):Void { EntryEJB = resData; EJBtext.text = textCon + "\n\nGot Bean Instance.\nEntryEJB: " + EntryEJB; } createRes.onStatus = function (resData:Object):Void { EJBtext.text = textCon + "\ncreate() - STATUS: \n" + resData.description; }
init(); stop();
FRAME2: var noiseRes:Object = new Object(); _global.System.onStatus = noiseRes.onStatus;
// Resulthandler noiseRes.onResult = function (resData:Object):Void { EJBtext.text = "makeSomeNoise() works!\n" + resData; } noiseRes.onStatus = function (resData:Object):Void { EJBtext.text = "makeSomeNoise() sucks.\n" + resData.description; }
EntryEJB.makeSomeNoise(noiseRes);
stop();
-- ---- ---- ---- ------ Yahoo! Groups Sponsor -- ---- ---- ---- ---~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/B87qlB/TM -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to: http://groups.yahoo.com/group/FSdesigners/
<*> To unsubscribe from this group, send an email to: FSdesigners-unsubscribe@(protected)
<*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
|
|
 |