the detail of HttpService

<mx:HTTPService id="registerService" showBusyCursor="true" useProxy="false" url="register.action" resultFormat="e4x" method="POST" result="registerConfirmation(event)" fault="registerFailed(event)"/>
 
 
  • register.action is the Struts 2 action that registers the user
  • registerConfirmation(event) is the function that is called if the http service call is successful.
  • registerFailed(event) is the function that is called if an error occurs. For example if the server is down. The event object gives you access to any xml/html that might be returned upon the call of the action.
  • resultFormat specifies in which format you want to view the results. It can be text, xml or an object. There are 5 possible values for this field:
    • object - An XML object is returned and is parsed as a tree of ActionScript objects
    • xml - Returns literal XML in an XMLNode object
    • e4x - Returns literal XML that can be accessed using ECMAScript for XML(E4X) expressions.
    • flashvars - The result is text in flashvars format, value pairs separated by ampersands. Flex returns this result in an actionscript object
    • array - The result is XML that is returned in an Array even if there is only one top level node.
  • 發表評論
    所有評論
    還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
    相關文章