2011-08-24 3 views
0

내 서비스에서 RemoteObject를 들으려고합니다. 모든 것이 잘 작동하지만 내 코드는 다음과 같습니다blazeDS - 기본 채널

<mx:AMFChannel id="myamf" uri="messagebroker/amf"/> 
<mx:ChannelSet id="channelSet" channels="{[myamf]}"/> 
<mx:RemoteObject id="ro" channelSet="{channelSet}" destination="pServ" result="resultHandler(event);" fault="faultHandler(event);"/> 

내 .mxml 파일에서 채널 URI를 입력 하드 피할 수있는 방법이 있나요?

나는 blazeds xml에서 기본 채널을 시도했지만 succes는 사용하지 않았습니다.

그게 내 구성 부품은 다음과 같습니다 aplication 파일의 루트에서 플렉스 응용 프로그램을 실행

봄 appContext.xml

<context:component-scan base-package="org.flex.test.services"/> 
<flex:message-broker> 
    <flex:remoting-service default-channels="my-amf"/> 
</flex:message-broker> 

<flex:remoting-destination ref="personService" destination-id="pServ"/> 

플렉스 서비스-config.xml에

<services> 
    <default-channels> 
     <channel ref="my-amf"/> 
    </default-channels> 

    <service id="remoting-service" class="flex.messaging.services.RemotingService"> 
     <adapters> 
      <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> 
     </adapters> 
    </service> 
</services> 

<channels > 
    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> 
     <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> 
    </channel-definition> 
</channels> 

임 - 주요 .html.

답변 해 주셔서 감사합니다.

답변

0

기본 채널이 작동하지만 컴파일러가 기본값이 무엇인지 알 수 있도록 컴파일러 인수로 services.xml에 대한 참조를 추가해야합니다. 이 같은 것이 트릭을해야합니다 ...

-services {Your base directory}\src\main\webapp\WEB-INF\flex\services-config.xml 
+0

고마워요! 그것은 완벽하게 작동합니다. – Kohegen