Also, a declaratively created request object is very difficult to debug.
I suggest you build that XML in an as function, then trace it out and
verify it is valid as a whole.  I suspect that you have invalid xml the
second time.

 

Using a utility will also let you do this, but simply tracing the XML
might be simpler.

 

Tracy

 

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Jason B
Sent: Monday, January 05, 2009 10:56 AM
To: [email protected]
Subject: [flexcoders] Re: error in HTTPService

 

show us your result="handleSimUpdateResult(event)" function

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "weezee49" <rainygl...@...> wrote:
>
> I have the following HTTPService:
> 
> <mx:HTTPService id="svcSimulationUpdate" 
> contentType="application/xml" 
> url="http://localhost:3000/simulations/
<http://localhost:3000/simulations/> 
> {userModelsCB.selectedItem.id}?_method=put"
> resultFormat="e4x" 
> method="POST" 
> result="handleSimUpdateResult(event)">
> <mx:request xmlns="">
> <data>
> <simulation>
> <name>{runControlBox.simNameTI.text}</name>
> <desc>{runControlBox.descTI.text}</desc>
> <run_length>{runControlBox.runLengthTI.text}</run_length>
> <time_units>{getTimeUnits
> (runControlBox.timeUnitsCB.selectedIndex)}</time_units>
> </simulation>
> <load>
> <simulation_id>{_selectedSim.id}</simulation_id>
> <name>Arrival1</name>
> <dist_type>{getDistName
> (loadBox.loadDistCB.selectedIndex)}</dist_type>
> <param1>{loadBox.loadParam1TI.text}</param1>
> <param2>{loadBox.loadParam2TI.text}</param2>
> <param3>{loadBox.loadParam3TI.text}</param3>
> <time_units>{getTimeUnits
> (loadBox.timeUnitsCB.selectedIndex)}</time_units>
> </load>
> <resource>
> <name>Server1</name>
> <simulation_id>{_selectedSim.id}</simulation_id>
> <capacity>{rscBox.capacityTI.text}</capacity>
> <dist_type>{getDistName
> (rscBox.distributionCB.selectedIndex)}</dist_type>
> <param1>{rscBox.distParam1TI.text}</param1>
> <param2>{rscBox.distParam2TI.text}</param2>
> <param3>{rscBox.distParam3TI.text}</param3>
> <time_units>{getTimeUnits
> (rscBox.timeUnitsCB.selectedIndex)}</time_units>
> </resource>
> <buffer>
> <name>Queue1</name>
> <simulation_id>{_selectedSim.id}</simulation_id>
> <capacity>{queueBox.capacityTI.text}</capacity>
> </buffer>
> </data>
> </mx:request>
> </mx:HTTPService>
> 
> This service works perfectly the first time - my data base is 
> updated correctly and everything is fine. However, if I try to run 
> the service again, I get a "Thread suspended" with an error that 
> starts out like this:
> 
> undefined
> at flash.xml::XMLNode()
> at flash.xml::XMLDocument/createElement()
> at mx.rpc.xml::SimpleXMLEncoder/encodeValue()
> [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\SimpleXMLEncoder
> .as:133]
> at mx.rpc.xml::SimpleXMLEncoder/encodeValue()
> [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\SimpleXMLEncoder
> .as:146]
> at mx.rpc.xml::SimpleXMLEncoder/encodeValue()
> [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\SimpleXMLEncoder
> .as:146]
> at mx.rpc.xml::SimpleXMLEncoder/encodeValue()
> [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\xml\SimpleXMLEncoder
> .as:146]
> ... 
> 
> I have verified that the fields used in the <mx:request> have the 
> correct data in them just before the send() call.
> 
> Why does the service work okay the first time but then die the 2nd 
> time?
> 
> Thanks,
> LG Rains
>

 

Reply via email to