This page was saved using jaction on 2006-09-04 8:33:45.
Address: http://flexdocs.kr/docs/flex2/langref/mx/rpc/http/mxml/HTTPService.html
Title: mx.rpc.http.mxml.HTTPService (Flex™ 2 레퍼런스 가이드)  •  Size: 60917
Packagemx.rpc.http.mxml
Classpublic class HTTPService
InheritanceHTTPService Inheritance HTTPService Inheritance AbstractInvoker Inheritance EventDispatcher Inheritance Object
ImplementsIMXMLObject , IMXMLSupport

<mx:HTTPService> 태그는, MXML 파일내에서 HTTPService object를 나타내기 위해서(때문에) 사용합니다. HTTPService object의 send() Methods를 호출하면, 지정한 URL 에 HTTP GET 또는 POST 요구가 보내져 HTTP 응답이 돌려주어집니다. 지정하는 URL 에 Parameters를 건네줄 수도 있습니다.

메모:소프트웨어의 제약에 의해, HTTPService 로 GET 요구를 사용했을 경우, 사용상의 편리인 에러 메세지는 생성되지 않습니다.

MXML 문장구조법expandedMXML 문장구조법의 비표시

<mx:HTTPService> 태그에서는, 이하의 태그 속성을 사용할 수 있습니다.

 <mx:HTTPService property concurrency="multiple|single|last" contentType="application/x-www-form-urlencoded|application/xml" destination="DefaultHTTP" id="디폴트치 없음" method="GET|POST|HEAD|OPTIONS|PUT|TRACE|DELETE" resultFormat="object|array|xml|e4x|flashvars|text" showBusyCursor="false|true" makeObjectsBindable="false|true" url="디폴트치 없음" useProxy="false|true" xmlEncode="디폴트치 없음" xmlDecode="디폴트치 없음" event fault="디폴트치 없음" result="디폴트치 없음" /> 
<mx:HTTPService> 태그는, Parameters를 지정할 수 있는 단일의 <mx:request> 태그를 가질 수가 있습니다.

View the examples

See also

mx.rpc.http.HTTPService
mx.validators.Validator
mx.managers.CursorManager
RPC 컴퍼넌트의 사용


Public property
 property정의
 InheritedchannelSet : ChannelSet
서비스가 사용하는 ChannelSet 에의 액세스를 제공합니다.
HTTPService
  concurrency : String
동일 서비스에 대한 복수의 호출의 처리 방법을 나타내는 값입니다.
HTTPService
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 InheritedcontentType : String = "application/x-www-form-urlencoded"
서비스 요구의 컨텐츠 타입입니다.
HTTPService
 Inheriteddestination : String
services-config.xml 파일내의 HTTPService 행선지명입니다.
HTTPService
 Inheritedheaders : Object
써드파티의 엔드 포인트에 송신되는 custom HTTP 헤더입니다.
HTTPService
 InheritedlastResult : Object
마지막 호출의 결과입니다.
AbstractInvoker
 InheritedmakeObjectsBindable : Boolean
이 값이 true 의 경우, 돌려주어진 익명 object는 강제적으로 바인드 가능 object로 됩니다.
AbstractInvoker
 Inheritedmethod : String = "GET"
요구를 송신하기 위한 HTTP Methods입니다.
HTTPService
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
 Inheritedrequest : Object
URL 에 건네주는 Parameters로서 사용되는, 이름과 값의 페어의 object입니다.
HTTPService
 InheritedrequestTimeout : int
송신 메세지의 요구 타임 아웃 시간 (초단위)에 대한 액세스를 제공합니다.
HTTPService
 InheritedresultFormat : String
HTTP 호출로부터 돌려주어진 결과를 비직렬화하는 방법을 나타내는 값입니다.
HTTPService
 InheritedrootURL : String
상대 URL 를 계산할 경우에, HTTPService object가 사용할 필요가 있는 URL 입니다.
HTTPService
  showBusyCursor : Boolean
true 의 경우, 서비스의 실행중에 Busy 커서가 표시됩니다.
HTTPService
 Inheritedurl : String
서비스의 장소를 나타냅니다.
HTTPService
 InheriteduseProxy : Boolean
Flex 의 프록시 서비스를 이용할지 어떨지를 지정합니다.
HTTPService
 InheritedxmlDecode : Function
서비스 결과를 XML 로부터 디코드할 때에 사용되는 ActionScript 함수입니다.
HTTPService
 InheritedxmlEncode : Function
서비스 요구를 XML 에 encode 하기 위해서 사용되는 ActionScript 함수입니다.
HTTPService
Public Methods
 Methods정의
  HTTPService ()
새로운 HTTPService 를 작성합니다.
HTTPService
 InheritedaddEventListener (type:String , listener:Function , useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
event listener objects를 EventDispatcher object에 등록해, listener가 이벤트의 통지를 받도록(듯이) 합니다.
EventDispatcher
  cancel ():void
마지막 HTTPService 요구를 캔슬합니다.
HTTPService
 InheritedclearResult (fireBindingEvent:Boolean = true):void
인보카의 result property를 null 로 설정합니다.
AbstractInvoker
 Inheriteddisconnect ():void
서비스의 네트워크 접속을 절단 합니다.
HTTPService
 InheriteddispatchEvent (event:Event ):Boolean
이벤트를 event 플로우(flow)에 dispatch합니다.
EventDispatcher
 InheritedhasEventListener (type:String ):Boolean
EventDispatcher object에, 특정의 event 타입에 대해서 등록된 listener가 있을지 어떨지를 확인합니다.
EventDispatcher
 InheritedhasOwnProperty (name:String ):Boolean
object로 지정된 property가 정의되고 있는지 어떤지를 나타냅니다.
Object
  initialized (document:Object , id:String ):void
이 클래스를 ActionScript 로 작성해, 검증으로 기능시키려면 , 이 Methods를 호출해, MXML 문서와 HTTPService 의 id 를 건네줄 필요가 있습니다.
HTTPService
 InheritedisPrototypeOf (theClass:Object ):Boolean
Object 클래스의 인스턴스가, Parameters로서 지정된 object의 prototype 체인내에 있을지 어떨지를 나타냅니다.
Object
 Inheritedlogout ():void
유저를 행선지로부터 로그아웃 합니다.
HTTPService
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedremoveEventListener (type:String , listener:Function , useCapture:Boolean = false):void
EventDispatcher object로부터 listener를 삭제합니다.
EventDispatcher
  send (parameters:Object = null):AsyncToken
HTTPService 요구를 실행합니다.
HTTPService
 InheritedsetCredentials (username:String , password:String ):void
서비스가 액세스 하는 행선지의 증명서를 설정합니다.
HTTPService
 InheritedsetPropertyIsEnumerable (name:String , isEnum:Boolean = true):void
루프 처리에 대한 다이나믹 property의 가용성을 설정합니다.
Object
 InheritedsetRemoteCredentials (remoteUsername:String , remotePassword:String ):void
유저가 HTTP URL 에 액세스 할 경우에, 유저를 인증하기 위한 유저명과 패스워드입니다.
HTTPService
 InheritedtoString ():String
지정된 object의 string 표현을 돌려줍니다.
Object
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
 InheritedwillTrigger (type:String ):Boolean
지정된 event 타입에 대해, 이 EventDispatcher object 또는 그 조상에게 event listener가 등록되어 있는지 어떤지를 확인합니다.
EventDispatcher
이벤트
 이벤트일람정의
 Inheritedfault HTTPService 호출이 실패했을 때에 dispatch됩니다. HTTPService
 Inheritedinvoke 채널이 메세지의 송신을 시도하기 전에 에러가 슬로우 되지 않는 이상 HTTPService 호출이 실행되면, invoke 이벤트가 개시됩니다. HTTPService
 Inheritedresult HTTPService 호출이 정상적으로 결과를 돌려주었을 때에 dispatch됩니다. HTTPService
Public 정수
 정수정의
 InheritedCONTENT_TYPE_FORM : String = "application/x-www-form-urlencoded"
[static] HTTP 서비스에 의해 송신중의 데이터가, application/x-www-form-urlencoded 로서 encode 되는 것을 나타냅니다.
HTTPService
 InheritedCONTENT_TYPE_XML : String = "application/xml"
[static] HTTP 서비스에 의해 송신중의 데이터가, application/xml 로서 encode 되는 것을 나타냅니다.
HTTPService
 InheritedDEFAULT_DESTINATION_HTTP : String = "DefaultHTTP"
[static] HTTPService object가 DefaultHTTP 행선지를 사용하는 것을 나타냅니다.
HTTPService
 InheritedDEFAULT_DESTINATION_HTTPS : String = "DefaultHTTPS"
[static] HTTPService object가 DefaultHTTPS 행선지를 사용하는 것을 나타냅니다.
HTTPService
 InheritedERROR_DECODING : String = "Client.CouldNotDecode"
[static] XML 형식의 결과를 XML 인스턴스에 해석할 수 없었는지, object에 디코드할 수 없었던 것을 나타냅니다.
HTTPService
 InheritedERROR_ENCODING : String = "Client.CouldNotEncode"
[static] 입력 Parameters를 XML 로서 encode 할 수 없었던 것을 나타냅니다.
HTTPService
 InheritedERROR_URL_REQUIRED : String = "Client.URLRequired"
[static] useProxy property가 false 로 설정되었지만, URL 가 제공되지 않았던 것을 나타냅니다.
HTTPService
 InheritedRESULT_FORMAT_ARRAY : String = "array"
[static] 결과 포맷 "array" 는 "object" 와 같습니다. 다만, 이 결과 포맷으로 돌려주어지는 값은 항상 배열로, 결과 포맷 "object" 로부터 돌려주어진 결과가 배열로 되어 있지 않은 경우에, 그 아이템이 최초의 아이템으로서 새로운 배열에 추가되도록(듯이) 합니다.
HTTPService
 InheritedRESULT_FORMAT_E4X : String = "e4x"
[static] 결과 포맷이 "e4x" 의 경우, 돌려주어지는 값은 XML 인스턴스입니다. 이 인스턴스에는, XML (E4X) 식용의 ECMAScript 를 사용해 액세스 할 수 있습니다.
HTTPService
 InheritedRESULT_FORMAT_FLASHVARS : String = "flashvars"
[static] 결과 포맷이 "flashvars" 의 경우, 돌려주어지는 값은 ampersand(&)로 단락지어진 이름과 값의 페어를 포함한 텍스트로, ActionScript object에 해석됩니다.
HTTPService
 InheritedRESULT_FORMAT_OBJECT : String = "object"
[static] 결과 포맷이 "object" 의 경우, 돌려주어지는 값은 XML 로, 다만 ActionScript object의 트리로서 해석됩니다.
HTTPService
 InheritedRESULT_FORMAT_TEXT : String = "text"
[static] 결과 포맷이 "text" 의 경우, HTTPService 결과 텍스트는 미처리의 string가 됩니다.
HTTPService
 InheritedRESULT_FORMAT_XML : String = "xml"
[static] 결과 포맷이 "xml" 의 경우, 결과는, 친 flash.xml.XMLDocument 의 최초의 아이를 지정하는 flash.xml.XMLNode 인스턴스로서 돌려주어집니다.
HTTPService
property의 상세
concurrencyproperty
public var concurrency:String

동일 서비스에 대한 복수의 호출의 처리 방법을 나타내는 값입니다. 디폴트치는 multiple 입니다. 사용할 수 있는 값은 다음과 같습니다.

showBusyCursorproperty 
showBusyCursor:Boolean   [read-write]

true 의 경우, 서비스의 실행중에 Busy 커서가 표시됩니다. 디폴트치는 false 입니다.

Implements
    public function get showBusyCursor():Boolean
    public function set showBusyCursor(value:Boolean ):void
constructor    의 상세
HTTPService()constructor   
public 함수 HTTPService()

새로운 HTTPService 를 작성합니다. 이 constructor    은 통상, MXML 문서의 생성이 끝난 코드로 불려 갑니다. ActionScript 로 HTTPService 를 작성하려면 , 통상은 mx.rpc.http.HTTPService 클래스를 사용합니다.

Methods의 상세
cancel()Methods
public override function cancel():void

마지막 HTTPService 요구를 캔슬합니다.

initialized()Methods 
public function initialized(document:Object , id:String ):void

이 클래스를 ActionScript 로 작성해, 검증으로 기능시키려면 , 이 Methods를 호출해, MXML 문서와 HTTPService 의 id 를 건네줄 필요가 있습니다.

Parameters
document:Object
 
id:String
send()Methods 
public override function send(parameters:Object = null):AsyncToken

HTTPService 요구를 실행합니다. Parameters는 옵션입니다만, 지정하는 경우에는 contentType 에 응해, 이름과 값의 페어가 들어간 object 또는 XML object로 할 필요가 있습니다.

Parameters
parameters:Object (default = null)

반환값
AsyncToken — AsyncToken 입니다. result event 또는 fault 이벤트의 token property로 사용 가능한 object와 같게 됩니다.
Examples
HTTPServiceExample
<? xml version="1.0"? >
<! -- Simple example to demonstrate the HTTPService tag.  -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="feedRequest.send();">

    <! -- The url property specifies the location of the requested file, 
    in this case the RSS 2.0 feed of Matt Chotin's blog.  
    As of this writing, the URL was still valid, but you should 
    check to make sure it hasn't changed.  
    You should use the latest RSS 2.0 URL listed on the right side of 
    the blog at http://www.adobe.com/go/mchotinblog.  -->

    <mx:HTTPService 
        id="feedRequest" 
        url="http://weblogs.macromedia.com/mchotin/index.xml" 
        useProxy="false" />

    <mx:Panel title="HTTPService Example" height="75%" width="75%" 
        paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">

        <mx:DataGrid id="dgPosts" height="50%" width="75%" 
            dataProvider="{feedRequest.lastResult.rss.channel.item}">
            <mx:columns>
                <mx:DataGridColumn headerText="Posts" dataField="title"/>
                <mx:DataGridColumn headerText="Date" dataField="pubDate"/>
            </mx:columns>
        </mx:DataGrid>

        <mx:TextArea height="50%" width="75%" htmlText="{dgPosts.selectedItem.description}"/>

    </mx:Panel>    
</mx:Application>






 

코멘트가 추가되었을 경우, 메일로 받기. | 코멘트 리포트

현재의 페이지: http://flexdocs.kr/docs/flex2/langref/mx/rpc/http/mxml/HTTPService.html