This will be a simple one for you guys:
There are 2 files involved: The flex file and the coldfusion file.
I am getting this error for my code base:
[RPC Fault faultString=''Error #1090: XML parser failure: element is malformed.'' faultCode=''Client.CouldNotDecode'' faultDetail=''null'']
at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\http\HTTPService.as:851 ]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:188]
at mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rp c\Responder.as:43]
at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\s rc\mx\rpc\AsyncRequest.as:74]
at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\proj ects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:403]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
-------------------------------------------------
The flex file is:
%26lt;?xml version=''1.0'' encoding=''utf-8''?%26gt;
%26lt;mx:Application
xmlns:mx=''http://www.adobe.com/2006/mxml'' layout=''absolute''
%26gt;
%26lt;mx:HTTPService id=''userRequest'' url=''http://localhost/URLTest/uploader.cfm
'' useProxy=''
false'' method=''POST''
%26gt;
%26lt;mx:request xmlns=''''
%26gt;
%26lt;username%26gt;{username.text}
%26lt;/username%26gt;
%26lt;emailaddress%26gt;{emailaddress.text}
%26lt;/emailaddress%26gt;
%26lt;color%26gt;{color.text}
%26lt;/color%26gt;
%26lt;/mx:request%26gt;
%26lt;/mx:HTTPService%26gt;
閵嗏偓
%26lt;mx:Form x=''22'' y=''10'' width=''493''
%26gt;
%26lt;mx:HBox%26gt;
%26lt;mx:Label text=''Username:''
/%26gt;
%26lt;mx:TextInput id=''username''
/%26gt;
%26lt;/mx:HBox%26gt;
%26lt;mx:HBox%26gt;
%26lt;mx:Label text=''EMail Address:''
/%26gt;
%26lt;mx:TextInput id=''emailaddress''
/%26gt;
%26lt;/mx:HBox%26gt;
%26lt;mx:FormItem label=''Favorite Color''
%26gt;
%26lt;mx:TextInput id=''color''
/%26gt;
%26lt;/mx:FormItem%26gt;
%26lt;mx:HBox%26gt;
%26lt;mx:Button label=''Submit'' click=''userRequest.send()''
/%26gt;
%26lt;/mx:HBox%26gt;
%26lt;/mx:Form%26gt;
%26lt;mx:DataGrid id=''dgUserRequest'' x=''22'' y=''155'' dataProvider=''{userRequest.lastResult.users.user}''
%26gt;
%26lt;mx:columns%26gt;
%26lt;mx:DataGridColumn headerText=''User ID'' dataField=''userid''
/%26gt;
%26lt;mx:DataGridColumn headerText=''User Name'' dataField=''username''
/%26gt;
%26lt;mx:DataGridColumn headerText=''Email Address'' dataField=''emailaddress''
/%26gt;
%26lt;mx:DataGridColumn headerText=''Color'' dataField=''color''/%26gt;
%26lt;/mx:columns%26gt;
%26lt;/mx:DataGrid%26gt;
---------------------------
The ColdFusion File is:
%26lt;cfprocessingdirective
pageencoding = ''utf-8'' suppressWhiteSpace = ''Yes''%26gt;
%26lt;cfif
isDefined(''username'')
and isDefined(''emailaddress'')
and isDefined(''color'')
and username NEQ ''''%26gt;
%26lt;cfquery name=''addempinfo'' datasource=''sample''%26gt;
INSERT INTO users (username, emailaddress, color)
VALUES (%26lt;cfqueryparam value=''#username#'' cfsqltype=''CF_SQL_VARCHAR'' maxlength=''255''%26gt;,
%26lt;cfqueryparam value=''#emailaddress#'' cfsqltype=''CF_SQL_VARCHAR'' maxlength=''255''%26gt;,
%26lt;CFQUERYparam VALue=''#color#'' cfsqltype=''cf_sql_varchar'' maxlength=''150''%26gt; )
%26lt;/cfquery%26gt;
%26lt;/cfif%26gt;
%26lt;cfquery name=''alluserinfo'' datasource=''sample''%26gt;
SELECT userid, username, emailaddress, color
FROM users
order by userid desc
%26lt;/cfquery%26gt;
%26lt;cfxml variable=''userXML''%26gt;
%26lt;users%26gt;
%26lt;cfloop query=''alluserinfo''%26gt;
%26lt;cfoutput%26gt;
%26lt;user%26gt;
%26lt;userid%26gt;#toString(userid)#%26lt;/userid%26gt;
%26lt;username%26gt;#username#%26lt;/username%26gt;
%26lt;emailaddress%26gt;#emailaddress#%26lt;/emailaddress%26gt;
%26lt;color%26gt;#color#%26lt;/color%26gt;
%26lt;/user%26gt;
%26lt;/cfoutput%26gt;
%26lt;/cfloop%26gt;
%26lt;/users%26gt;
%26lt;/cfxml%26gt;
%26lt;cfoutput%26gt;#userXML#%26lt;/cfoutput%26gt;
%26lt;/cfprocessingdirective%26gt;
%26lt;/mx:Application%26gt;
No comments:
Post a Comment