How to use URL in actionscript  Instead of services-config.xml?

Hi Alls,
I would like to set my service's url in actionScript (I don't
want to use compiler option -services witch need to recompile swf
if you change service's url).
I search for a long time on google but I found nothing, and
adobe documentation isn't very clear.
Thank for help!!!

If you are relying on a services-config.xml file, then this
must be provided
at compile time because the compiler uses it to generate
code.
If you're not using <mx:DataService>, you can actually
avoid compiling against
a services-config.xml file. This is because for the other
services, such
as <mx:RemoteObject> or <mx:WebService
useProxy="true"> or <mx:HTTPService
useProxy="true">, the main thing the compiler does from
services-config.xml
is to generate the code to instantiate the set of channels
that should be
used to contact a destination in LCDS.
Well... you can do that programmatically in ActionScript...
something like
this:
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
private function channelInit():void
var channelSet:ChannelSet = new ChannelSet();
var channel:AMFChannel = new AMFChannel(null, "
http://{server.name}:{server.port}/mycontext/messagebroker/amf");
channelSet.addChannel(channel);
myRemoteObject.channelSet = channelSet;
Just make sure you call this initialization code before you
make any service
requests. If you're proxied WebServices, be sure that you use
the ActionScript
API instead of the MXML tag so that you can delay when
loadWSDL() is called
because you'll want to setup the channelSet first.
Regards,
Pete
Hello FredFlex,
> Hi Alls,
>
> I would like to set my service's url in actionScript (I
don't want to
> use compiler option -services witch need to recompile
swf if you
> change service's url).
>
> I search for a long time on google but I found nothing,
and adobe
> documentation isn't very clear.
>
> Thank for help!!!
>

Similar Messages

  • ADF:How to use NavigationHandler in Phase-Listener with adfc-config.xml

    Hi,
    in our application a user should be navigated to the login-page, when he tries to navigate directly to a page where he has no right for or if the session is expired.
    Our navigation is complete in the adfc-config.xml. So I created a phase-listener, which is called by the adf-settings.xml.
    Inside the phase-listener I'm checking the rights. If the user doesn't have the needed rights, he should be linked to the login page. But how can I do that?
    Some days ago our navigation has been complete in the faces-config.xml. But now we moved the navigation to the adfc-config.xml, because we are sure that it's better. E.g. for using the dialog framework.
    In the face-config.xml we had also the call of the phase-listener. There we did the forwarding like this and it worked:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, null, "login_page");But now I think I have to use the ADFContext somehow, or?
    So how can I do that with the adfc-config.xml?
    Thanks a lot for your help,
    Bastian
    I'm using JDeveloper 11g Release 1 (11.1.1.3.0)

    Hello Frank,
    thanks for your answer, but it doesn't really help me, because I'm a newbie, sorry.
    Does your answer mean, that I should leave the call of the phase-listener in the faces-config and then I would also have access to the login-page, which is in the adfc-config?
    Or does it mean, that I call now my phase-listener by adf-settings but don't have to change the phase-listener itself and can still use my code (FacesContext...)? But that's not working. I get no error but he is also not redirecting.
    Maybe my problem starts on an earlier point.
    Is it better to create all pages in the adfc-config or faces-config? (Maybe you have a good reference for reading about such a basic discussion)
    I thought adfc-config would be the better one. But there I'm not able to redirect to another page (login) if somebody calls a special page without rights for example.
    So my second basic question would be about the relation of adfc-config, faces-config and ADFContext and FacesContext.
    Because I think it's not a short answer I hope you could give me also for this a reference so that I can read these basics myself.
    Thanks a lot for helping a newbie becoming better :-)
    Bastian

  • How to use HTTPSERVICE in Actionscript project.

    Hello all,
    I am doing an actionscript project, I want to use httpservice to send a data to server . Is any one knows how to use httpservice in actionscript project?
    thanx

    following code may help:
    import mx.rpc.http.HTTPService;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    private function callHTTPSERVIDE():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Server.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    //handle your result here
    private function faultHandler( event:FaultEvent ):void
    // code for fault handling.

  • How to use "url.openStream()" . What this function does?

    how to use "url.openStream()" . What this function does?
    Edited by: sahil1287 on Apr 16, 2009 10:02 PM

    http://java.sun.com/javase/6/docs/api/java/net/URL.html#openStream()
    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

  • How  to use url iview???

    how  to use url iview???
    HI all
    I need to use url iview as back button in the same page with saptransaction iview.
    url iview to used as back button to the home page.
    pl suggeest how to use url ivew....what sort of properties need to be  used.

    HI chander
    thank u for ur response
    I have done an  aplication in which  i have called sap transsaction ivew usind quick link property in .html(page) language.
    where we will be fetching saplogon server using this sap trans saction ivew into the portal frame work  .
    when i loging into the server and log off  with in the portal frame work i am not able to go to my aplication home page. since back/ forward link are disabled.
    atleast i want know how to enable those links.
    or else
    i thought to use url ivew along with sap transaction ivew with a  same page with diffrent layouts.but that is also fine.
    and one   more option  was
    i thought it to be used as pop up as so that when user  login and log off into the server  they will close  that seperate window.
    for that i have set the  ivew property
    "launch in a new window property As : display in a seperate head less portal window"
    but even that is also not working.
    i dont know y  that property is not working
    finally i have coded with java script , now i am able to open the portal in a seperate window but with headed portal.
    for that i have coded some thing like below mentioned.
    problem here is still i am getting the headed portal
    but i want head less portal.
    here headless in the sence i want it like the preview of the ivew.
    please help me in this regard how to get the head less portal when i click on the link.
    Regards
    Gayathri

  • How to use JOptionPane in jsp, instead of javascript message alert box?

    HI,
    How to use JOptionPane in jsp,
    instead of javascript "message alert box"?
    I hate javascript,
    I'd like to only use java in jsp. don't use javascript.
    javascript is client side,
    jsp is server side. i know that.
    how to... instead of javascript box?
    how to use ... message box in webpage?
    don't use applet,,,, don't use javascript,,,
    hm...zzzZzz
    I hate javascript..T.T
    <SCRIPT language=JavaScript>
    alert("hate javascript");
    </SCRIPT>
    ===>>>>
    In this way,,
    JOptionPane.showOptionDialog(null,"I love java")
    I'd like to only use jsp and java and html...in webpage.
    don't use javascript....
    Why? don't sun provide message box in jsp, instead of javascrip box?
    Why?
    Edited by: seong-ki on Nov 4, 2007 8:38 PM

    Drugs are bad, m'kay?

  • How to use Batch operation for two xsodata services?

    Hi All,
    I have two xsodata services. How to use submit batch for two xsodata services
    Thanks,
         Mj

    Gateway Batch Calls from SAPUI5

  • How to use WebCenter Spaces 11g 2.0 Services in WebCenter Interaction 10gR3

    Hi,
    Can someone explain how to use WebCenter 11g Web 2.0 Services in WebCenter Interaction 10gR3. I have installed Webcenter 11g Spaces. I also have Webcenter Interaction 10gR3 installed. Wanted to find out how can I make use of 11g web 2.0 services i.e. wiki,blog,discussions etc. in WCI 10gR3. How can I configure those services in 10gR3.
    As reading oracle notes it says there is a seemless integration of Web 2.0 11g Services in WCI 10gR3 but can't find any steps, tutorials or examples on how to do that. Any help is appreciated.
    Thanks.

    guest0012 wrote:
    As reading oracle notes it says there is a seamless integration of Web 2.0 11g Services in WCI 10gR3 but can't find any steps, tutorials or examples on how to do that.Nothing like that seamless integration with zero documentation:)

  • Services-config.xml with actionscript

    I am amazed there is no half way simple method for creating a RTMP consumer without the need for this services-config.xml file. I have to be able to change, on the fly, what server the Flex client subscribes to and have multiple channels open to multiple servers. Maybe this is beyond the scope or capabilities of the RemoteObject, but we should be able create a consumer, channels, adapters and anything else we need without having to use the services-config.xml file.
    So here is the actual problem, I have everything working with the exception of messages being returned from the server are never received. I can set up the channels and channelsets, the consumer, and can subscribe and get an ack message back saying it is connected, but no messages ever come back. And yes, we have confirmed the service is getting the subscription and is sending data back to the client if we use the services-config.xml methodology and watch server logs.
    In our services-config.xml, I see
    <adapters>
         <adapter-definition id="messagingAdapter" class="FluorineFx.Messaging.Services.Messaging.MessagingAdapter" default="true"/>
    </adapters>
    Is there some way via actionscript to set up these adapters? Even if it means creating custom XML on the fly for the objects to parse thru, which I'm already doing in some places. Where are the adapters definable other than the services-config.xml?
    Thanks.
    Well the apadters have nothing to do with it as I can remove the mention from the xml and doing things via mxml still works and the AS3 stuff still doesn't work.
    Message was edited by: SchmaltzyMann

    Ah I see they've included it in a seperate file:
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service"
        class="flex.messaging.services.RemotingService"
        messageTypes="flex.messaging.messages.RemotingMessage">
        <adapters>
            <adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
            <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"/>
        </adapters>
        <default-channels>
            <channel ref="my-cfamf"/>
        </default-channels>
        <destination id="ColdFusion">
            <channels>
                <channel ref="my-cfamf"/>
            </channels>
            <properties>
                <source>*</source>
            </properties>
        </destination>
    </service>

  • How this services-config.xml works?

    I going through some  gettingstarted examples of using flex with AMFPHP I got it working. But to be honest, I don’t understand this services-config.xml file
    Given:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
          <services>
                <service id="remoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                      <destination id="amfphp">
                            <channels>
                                  <channel ref="my-amfphp"/>
                            </channels>
                            <properties>
                                  <source>*</source>
                            </properties>
                      </destination>
                </service>
          </services>
          <channels>
                <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
                      <endpoint uri="http://localhost/amfphp/gateway.php"
                      class="flex.messaging.endpoints.AMFEndpoint"/>
                </channel-definition>
          </channels>
    </services-config>
    The only info from that file i use in my RemoteObject is this destination atttribut:
    <mx:RemoteObject destination="amfphp" …/>
    But what I don’t understand way they split the services-tag from channels-tag and most important how do they relate? Could somebody explain this or hint me to some easy to understand tutorial?
    I tried to read adobe livedocs on Using RPC Components etc but it is so confusing, to be honest i don’t understand a word of it. what exacly is service-tag and channel-tag and whay i have to use both of them- i mean one will never switch my amfphp endpoint at runtime, will one? And way?
    (ok, that destination has channel ref which reference the “other” channel-tag which points to my amfphp-gateway -but so what? what does it mean, way so commplicated - Wouldn’t it be easier if one would jut give the endpoint attribute to the RemoteObject and everything is fine?)
    Thankful for any help

    Maybe this will help?
    http://www.sephiroth.it/tutorials/flashPHP/flex_remoteobject/page001.php

  • How can the client know if the SSL certificate specified in the service-config.xml file is invalid/u

    Hi,
    How can the client know if the SSL certificate specified in the service-config.xml file is invalid/untrusted/expired? For example using iOS client, the trusted certificate will not work and the client has no way to know that the certificate is untrusted. Can the lcds server return any specific exceptions for SSL errors?
    Thanks,
    Swathi.

    We use a standard Java keystore and certificate validation can be handled as per standard best practices. At present we do not provide a hook point to validate the server certificate. However, you can register a bootstrap service which validates the certificate on system startup: http://help.adobe.com/en_US/dataservicesjee/4.6/Developing/WSc3ff6d0ea77859461172e0811f00f 6fe7f-7ffeUpdate.html This would require you to pass another copy of the keystore configuration to you Bootstrap service and then you can inspect the certificate in the keystore and validate it.

  • Do I need the 'java-polling-amf in my services-config.xml if I'm using coldfusion

    Do I need the 'java-polling-amf in my services-config.xml if I'm using coldfusion?
    Im using IntelliJ IDEA with a flex project and for some reason its stopping comilation with this error:
    [SUITE (Flex Application 1)] flex.messaging.config.ConfigurationException: The services configuration includes a channel-definition 'java-polling-amf' that has an endpoint with a context.root token but a context root has not been defined. Please specify a context-root compiler argument.
    when I was using flex builder with CF builder I never needed to specify the context.root

    I don't use IDEA, so I don't know what kind of configuration settings it has for Flex project development.
    You don't need the java-polling-amf channel for CF development. By default, CF development uses CF-specific channels:
    my-cfamf
    cf-polling-amf
    my-cfamf-secure
    any custom channels you've created yourself for CF to use
    That said, all the channels require a context root setting for your project to compile properly. If you still have Flash Builder handy, take a look at your compiler switches for a project there to see what you're missing in IDEA.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • [svn:bz-trunk] 8910: Bug: LCDS-936 - Should have better error message in servlet log if server in services-config .xml is configured to use wrong class.

    Revision: 8910
    Author:   [email protected]
    Date:     2009-07-29 14:22:26 -0700 (Wed, 29 Jul 2009)
    Log Message:
    Bug: LCDS-936 - Should have better error message in servlet log if server in services-config.xml is configured to use wrong class.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Ticket Links:
        http://bugs.adobe.com/jira/browse/LCDS-936
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerServlet.java

    After many hard working days.i finally found the error cause,i needed to make weblogic datasource also ADF doesnt work on internet explorer browser,it works on safary.hope it helps somebody

  • How to set services-config.xml?

    Hi,
    Hi,
    I am confusing for how to set services-config.xml(configuring
    channels and destinations) for <mx:RemoteObject>.
    Please give me a simple demo .Thanks
    MK

    Maybe this will help?
    http://www.sephiroth.it/tutorials/flashPHP/flex_remoteobject/page001.php

  • How to use URL class instead of Socket

    Hi all. I am developing a small inventory control system for a warehouse.
    I am suing a Java desktop application that connects to a servlet via Internet.
    I have been searching the net how to use JSSE for my application since i am new to secure sockets and JSSE.
    Since I havent implemented security In my current system yet, i am using URLConnection conn = url.openConnection(); to connect to a servlet.
    However, in a good tutorial that I found about JSSE, sockets are used directly for connection, insted of URLCOnnection. They use the code like this: SSLSocketFactory sf = sslContext.getSocketFactory();
    SSLSocket socket = (SSLSocket)sf.createSocket( host, port ); Since, using sockets is overly complex for me, I want to make use of the URLConnection class instead to keep it simple.
    Could anyone please tell me how to make use of the URLConnection class to establish secure http connection.
    by the way, the tutorial is here:
    http://www.panix.com/~mito/articles/articles/jsse/j-jsse-ltr.pdf
    thanks.

    Here you go. The following code snippet allows you post data to http URL. If you have to do the same to https URL , please let me know.
    OutputStream writeOut = null;
    HttpURLConnection appConnection = null;
    URL appUrlOpen = null;
    //data to be posted.
    String data = "This is the test message to post";
    byte[] bytesData = this.data.getBytes();
    appUrlOpen = new URL(""Your Servlet URL");
    appConnection = (HttpURLConnection) appUrlOpen.openConnection();
    appConnection.setDoOutput(true);
    appConnection.setDoInput(true);
    appConnection.setUseCaches(false);
    appConnection.setInstanceFollowRedirects(false);
    appConnection.setRequestMethod("post");
    appConnection.setRequestProperty("Content-Type","application/text");
    appConnection.setRequestProperty("Content-length", String.valueOf(bytesData.length));
    writeOut=appConnection.getOutputStream();
    writeOut.write(bytesData);
    writeOut.flush();
    writeOut.close();
    String inputLine;
    StringBuffer sb = new StringBuffer();
    reader = new BufferedReader(new InputStreamReader(appConnection.getInputStream()));
    char chars[] = new char[1024];
    int len = 0;
    //Write chunks of characters to the StringBuffer
    while ((len = reader.read(chars, 0, chars.length)) >= 0)
    sb.append(chars, 0, len);
    System.out.println("Response " + sb.toString());
    reader.close();
    sb=null;
    chars = null;
    responseBytes = null;
    ******************************************************************************************

Maybe you are looking for

  • KPIs for SD:Sales Orders & Delivery

    Hi Experts, Could some one please help me out to find out different KPIs for SD : Sales Orders & Delivery. Am trying to create a BEx report for SD mofule using custom list of KPIs. Any source where i could find the KPIs for SD module. Thanks in advan

  • Problem in starting the Netweaver Server...

    Hi, We have installed Netweaver 04s in Linux x86_64 platform with Oracle 10g. The Installation went fine and it started the server by itself once the installation was complete and we were able to get the home page of the appln server. However when we

  • How can I change SGA_MAX_SIZE IN oRACLE 10G.

    Dear Experts, Please tell me How can I change SGA_MAX_SIZE IN Oracle 10G. How can I change SGA_TARGET IN Oracle 10G. How Can i recreate SPFILE.

  • Value and context and queue diff

    Hi people           In UDF editor cache, what is the use and diff between value and context queue radio buttons Thanks Shekar

  • No disconnect warning when multiple remote users use same username and password to logon to VM

    I created a single user account to be used by multiple users to access a system consisting of multiple VMs. The problem is that when User #1 has an active session and User #2 attempts to log onto the same VM User #1's session is ended without warning