Eu tentei este exemplo: 
http://coenraets.org/blog/2009/03/externalizing-service-configuration-using-blazeds-and-lcds/
do CHRISTOPHE COENRAETS, porem nao funfou.. abaixo o codigo:


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
                                creationComplete="configSrv.send()"
                                layout="absolute">

        <mx:Script>
                <![CDATA[
                        import mx.messaging.channels.AMFChannel;
                        import mx.controls.Alert;
                        import mx.rpc.events.FaultEvent;
                        import mx.rpc.events.ResultEvent;
                        import mx.messaging.ChannelSet;


                        private var channelSet:ChannelSet;

                        private function 
onResultPegaServidor(ev:ResultEvent):void {
                                var xml                 :XML     = ev.result as 
XML;
                                var amfEndpoint :String  = "" + xml..channel.
(@id=="amf")....@endpoint;
                                if ( amfEndpoint == "" )
                                        Alert.show("ERRO AO CONFIGURAR");
                            else {
                                channelSet = new ChannelSet();
                                var channel:AMFChannel = new 
AMFChannel("my-amf",amfEndpoint);
                                channelSet.addChannel(channel);
                                ro.channelSet = channelSet;
                                ro.devolveNome();
                                Alert.show(amfEndpoint);
                            }
                        }

                        private function onFaultServidor(fl:FaultEvent):void {
                                Alert.buttonHeight = 100;
                                Alert.buttonWidth  = 140
                                Alert.show(fl.fault.toString());
                        }

                        private function onResultControle(rs:ResultEvent):void {
                                Alert.show(rs.result.toString());
                        }

                        private function erro(fl:FaultEvent):void {

                                Alert.show(fl.fault.toString());
                        }

                ]]>
        </mx:Script>

        <mx:RemoteObject id="ro" destination="PegaNome" fault="erro(event)">
                <mx:method name="devolveNome" result="onResultControle(event)"/>
        </mx:RemoteObject>

        <mx:HTTPService id="configSrv" url="config.xml"
                                        fault="onFaultServidor(event)"
                                        resultFormat="e4x" 
result="onResultPegaServidor(event)"/>

</mx:Application>


Meu config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
        <channels>
                <channel id="amf" endpoint="http://localhost:8080/PROJA/
messagebroker/amf"/>
        </channels>
</config>


Quando eu executo gera este erro: [RPC Fault faultString="Send failed"
faultCode="Client.Error.MessageSend"
faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed:
HTTP: Status 404: url: 'http://localhost:8080/PROJA/messagebroker/
amf'"]

Em service-confi.xml do BLAZE que esta dentro da Pasta PROJA no tom
cat:

<?xml version="1.0" encoding="UTF-8"?>
<services-config>

    <services>

        <service class="flex.samples.DatabaseCheckService"
id="hsqldb" />

        <service-include file-path="remoting-config.xml" />
        <service-include file-path="proxy-config.xml" />
        <service-include file-path="messaging-config.xml" />

            <service
class="flex.samples.runtimeconfig.EmployeeRuntimeRemotingDestination"
id="runtime-employee-ro" />

        <!--
        Application level default channels. Application level default
channels are
        necessary when a dynamic destination is being used by a service
component
        and no ChannelSet has been defined for the service component. In
that case,
        application level default channels will be used to contact the
destination.
        -->
        <default-channels>
           <channel ref="my-amf"/>
        </default-channels>

        </services>


    <security>
        <security-constraint id="sample-users">
            <auth-method>Custom</auth-method>
            <roles>
                <role>sampleusers</role>
            </roles>
        </security-constraint>

                <login-command 
class="flex.messaging.security.TomcatLoginCommand"
server="Tomcat"/>
        <!-- Uncomment the correct app server
        <login-command
class="flex.messaging.security.TomcatLoginCommand" server="JBoss">
        <login-command
class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
        <login-command
class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/
>
        <login-command
class="flex.messaging.security.WebSphereLoginCommand"
server="WebSphere"/>
        -->
    </security>

    <channels>

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

        <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"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>


        <channel-definition id="my-secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
            <endpoint url="https://{server.name}:{server.port}/
{context.root}/messagebroker/amfsecure"
class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

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

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

        <channel-definition id="my-secure-http"
class="mx.messaging.channels.SecureHTTPChannel">
            <endpoint url="https://{server.name}:{server.port}/
{context.root}/messagebroker/httpsecure"
class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

        <channel-definition id="per-client-qos-polling-amf"
class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/
{context.root}/messagebroker/qosamfpolling"
class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-millis>500</polling-interval-millis>
                <flex-client-outbound-queue-processor
class="flex.samples.qos.CustomDelayQueueProcessor">
                    <properties>
                        <flush-delay>5000</flush-delay>
                    </properties>
                </flex-client-outbound-queue-processor>
            </properties>
        </channel-definition>

    </channels>

    <logging>
        <!-- You may also use flex.messaging.log.ServletLogTarget -->
        <target class="flex.messaging.log.ConsoleTarget"
level="Error">
            <properties>
                <prefix>[BlazeDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>true</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
    </logging>

    <system>
        <redeploy>
            <enabled>true</enabled>
            <watch-interval>20</watch-interval>
            <watch-file>{context.root}/WEB-INF/flex/services-
config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</
watch-file>
            <watch-file>{context.root}/WEB-INF/flex/remoting-
config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/messaging-
config.xml</watch-file>
            <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
        </redeploy>
    </system>

</services-config>


O que estou fazendo errado?



On 8 abr, 13:18, joao zaratine <zarat...@gmail.com> wrote:
> Talvez aquihttp://livedocs.adobe.com/blazeds/1/blazeds_devguide/
>
> Abraços!
> João Augusto
> blog.joaoaugusto.com.br
>
> Em 8 de abril de 2010 13:03, Michael Antunes
> <michaelantu...@terra.com.br>escreveu:
>
>
>
>
>
> > Bha cara, ainda nao consegui, sabe onde osso encontrar algo?
>
> > On 8 abr, 11:56, joao zaratine <zarat...@gmail.com> wrote:
> > > Olá Michael,
>
> > > aqui trabalhamos com uma aplicação que também é deployada em vários
> > > ambiente, com hosts diferentes, portas diferentes etc, mas nunca tivemos
> > > esse problema pois dentro do services-config definimos os endpoints com
> > > variáveis:
>
> > > <channel-definition id="my-amf"
> > >             class="mx.messaging.channels.AMFChannel">
> > >             <endpoint url="http://{server.name
> > }:{server.port}/messagebroker/amf"
>
> > >                 class="flex.messaging.endpoints.AMFEndpoint" />
> > >         </channel-definition>
>
> > > Estou ficando louco?
>
> > > Abraços!
> > > João Augusto Zaratine
> > > blog.joaoaugusto.com.br
>
> > > Em 8 de abril de 2010 11:28, Mário Júnior <juninho...@gmail.com>
> > escreveu:
>
> > > > Voce pode criar Channels e definir um ChannelSet dinamicamente em
> > runtime.
> > > > Dá uma pesquisada por esses termos aqui no histórico pois isso já foi
> > > > discutido, inclusive com o trecho de código disponivel (coisa de 4 ou 5
> > > > linhas no max)
>
> > > > []s
>
> > > > Em 8 de abril de 2010 09:30, Michael Antunes <
> > michaelantu...@terra.com.br>escreveu:
>
> > > > E ai pessoal, tranqüilo?
>
> > > >> Eu tenho uma aplicação Flex / Java / BlazeDS.  Bom, nós possuímos um
> > > >> sistema que é publicado em dois endereços diferentes, muda tudo o nome
> > > >> do servidor, a porta e o root.  Como o projeto é grande, em uma
> > > >> atualização perdemos muito tempo substituindo os endpoint do Services-
> > > >> Config e depois exportando o projeto.
>
> > > >> A pergunta é a seguinte: Existe uma maneira em que eu exporte o
> > > >> projeto apenas uma vez e ao publicar nos dois endereços ele
> > > >> automaticamente "entenda" os valores do endpoint???
>
> > > >> --
> > > >> Você recebeu esta mensagem porque está inscrito na lista "flexdev"
> > > >> Para enviar uma mensagem, envie um e-mail para
> > flexdev@googlegroups.com
> > > >> Para sair da lista, envie um email em branco para
> > > >> flexdev-unsubscr...@googlegroups.com
> > > >> Mais opções estão disponíveis emhttp://
> > groups.google.com/group/flexdev
>
> > > > --
> > > > Mario Junior
> > > >http://blog.mariojunior.com/
> > > > @mariojunior
>
> > > >  --
> > > > Você recebeu esta mensagem porque está inscrito na lista "flexdev"
> > > > Para enviar uma mensagem, envie um e-mail para
> > flexdev@googlegroups.com
> > > > Para sair da lista, envie um email em branco para
> > > > flexdev-unsubscr...@googlegroups.com
> > > > Mais opções estão disponíveis emhttp://groups.google.com/group/flexdev
>
> > > --
> > > João Augusto Zaratine
> > > blog.joaoaugusto.com.br
>
> > --
> > Você recebeu esta mensagem porque está inscrito na lista "flexdev"
> > Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com
> > Para sair da lista, envie um email em branco para
> > flexdev-unsubscr...@googlegroups.com
> > Mais opções estão disponíveis emhttp://groups.google.com/group/flexdev
>
> > To unsubscribe, reply using "remove me" as the subject.
>
> --
> João Augusto Zaratine
> blog.joaoaugusto.com.br

-- 
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com
Para sair da lista, envie um email em branco para 
flexdev-unsubscr...@googlegroups.com
Mais opções estão disponíveis em http://groups.google.com/group/flexdev

Responder a