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
Similar Messages
-
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: SchmaltzyMannAh 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> -
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.
-
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
MKMaybe this will help?
http://www.sephiroth.it/tutorials/flashPHP/flex_remoteobject/page001.php -
FB3B2 services-config.xml stopped working
My App worked fine in FlexBuilder3 (Beta 1 I suppose –
yes, I'm sure it wasn't FlexBuilder2).
I upgraded to FB3B2 and I now get the compiler error:
Invalid endpoint port '' specified for channel definition
'my-amfphp'
I've attached my services-config.xml
if I take out -services "services-config.xml" from my
compiler options in flexbuilder my app compiles fine and runs
(though of course it can't retrieve data from the server).
What can I do to resolve this problem? I'm using Cairngorm
2.2.1 Beta and CairngormEnterprise 2.2.1 Beta (though I'm not sure
I really need that)Ok, this is not good at all...adding the port as I described
works great if you have the new Flash Player, but breaks the flash
remoting connection on Firefox if you have Flash Player 9.0.47.0!!!
This is not good since this is the shipping flash player and the
one that most of our customers are currently using!!!
To fix this problem for our customers I had to go back to
Flex Builder 3 Beta 1 so that I could build my product without the
port!
Is this just a "strict" compiler issue? If so, can you please
make this error go away? My app has been working without strictly
naming the port in the URL for a long time!
Thanks -
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!!!
> -
Hi,
I am tryng to create a Flex Project, but got stuck with an error....
The Error is Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml.
Initially I download jboss-5.1.0.GA and placed it in C folder.
While creating project, I selected J2EE server, selected remote object access service and LiveCycle Data Services...
In the next step, I de-selected the use default location for local LiveCycle Data Services server.
In the root folder - C:\jboss-5.1.0.GA
for Root URL: http://localhost:8700/flex/
Context Root: /flex
when I clicl Validate Configuration.. this is the error I get Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml.
I can't understand what is going wrong here....any ideas....
Thanks for the Help.....
ThanksRun the wizard, select ColdFusion as the server technology, but don't
check the option to use remote object access service. Then, open the
project properties dialog, go to the Flex Compiler page, and add a the
compiler flag: -services
"C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml" (obviously
changing the path as appropriate). This flag is what gets set by the
wizard when you opt to use Flash Remoting. -http://www.feed-squirrel.com/index.cfm?evt=viewItem&ID=77732
Above is a work-around/solution that was successful for me. Below are screen shots of how I initially configured the project, following the above solution.
In the image above, notice how I didn't tick the "Use remote object access service" checkbox.
For the image below, the 'Y:\' value is a mapped network directory to my server (IIS) webroot, which is "\\windowsserver/Inetpub/wwwroot/". Root URL is the name of my server. Fill in the fields with correct values and hit finish.
Then navigate ( Project>Properties>Flex Compiler ) to this project's 'Flex Compiler context menu.
And 'W:\' is another mapped network directory that points obviously to my Coldfusion's WEB-INF\flex.
I hope that this helps. As you may see, I'm hoping that this will help you and others that are likely to come across problem. -
WEB-INF/flex/services-config.xml???
I am confused about this file and it's location. In my
environment (MX
7.02/Apache/Linux) the WEB-INF/flex/ folder resides here:
/opt/coldfusionmx7/wwwroot/WEB-INF/flex/
However, the server is configured to serve web pages from
this location:
/apache/html/
my /CFIDE/ folder is located at /apache/html/CFIDE/ but I
have no WEB-INF
folder except in the default location that isn't served up by
the web
server. As I understand it, for flash remoting to work, I
must have the
WEB-INF/flex/ folder in the root of my web server or in the
working folder
of my flex project ON the web server? Is this correct? If so,
must I copy
the WEB-INF folder to my working web document root folder?
I'm very
confused and so far have had HORRIBLE luck trying to get the
most simple
examples to run between Flex and Coldfusion. I am hoping
someone can tell
me what I'm doing wrong or at least point me to some
documentation that
doesn't appear to assume you are running Coldfusion in
Developer mode from
your local workstation (which ALL the samples appear to do).
Thanks for any help, I configured the coldfusion servers here
so I can make
the needed changes, if I only knew what they were and the
documentation
hasn't helped me much.
...BradRun the wizard, select ColdFusion as the server technology, but don't
check the option to use remote object access service. Then, open the
project properties dialog, go to the Flex Compiler page, and add a the
compiler flag: -services
"C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml" (obviously
changing the path as appropriate). This flag is what gets set by the
wizard when you opt to use Flash Remoting. -http://www.feed-squirrel.com/index.cfm?evt=viewItem&ID=77732
Above is a work-around/solution that was successful for me. Below are screen shots of how I initially configured the project, following the above solution.
In the image above, notice how I didn't tick the "Use remote object access service" checkbox.
For the image below, the 'Y:\' value is a mapped network directory to my server (IIS) webroot, which is "\\windowsserver/Inetpub/wwwroot/". Root URL is the name of my server. Fill in the fields with correct values and hit finish.
Then navigate ( Project>Properties>Flex Compiler ) to this project's 'Flex Compiler context menu.
And 'W:\' is another mapped network directory that points obviously to my Coldfusion's WEB-INF\flex.
I hope that this helps. As you may see, I'm hoping that this will help you and others that are likely to come across problem. -
Services-config.xml has changed quite a lot in CF9
I've noticed that the services-config.xml has changed quite a lot in CF9
I can't see
<destination id="ColdFusion">
<channels>
<channel ref="my-cfamf"/>
</channels>
in the file.
So I wonder how my flex apps still work with code like this:
<mx:RemoteObject id="myService" destination="ColdFusion"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> -
Revision: 3867
Author: [email protected]
Date: 2008-10-24 07:13:10 -0700 (Fri, 24 Oct 2008)
Log Message:
Add new user-agent info to the sample services-config.xml file.
Modified Paths:
blazeds/trunk/resources/config/services-config.xmlResolved! The problem was in the php code the wizard had generated as an example and that I had edited in Dreamweaver. I had tried to start a session and set session objects in the php code. I developed if() { statements} to check the session variable before executing the function in some of my data services. Apparently the wizard does not like this. I removed all references to session. I reconfigured the input types and the return types for each service. With the code now clean the wizard created the example code and placed the proper package in the scr.services package. I still have custom php code and it executes.
Things I learned:
If the php code stops when a session variable is not available in the if statement and the data service is refreshed, the wizard will not "look" beyond the if statement.
Functions downstream of a session variable misshap will show in the data services window but the functions will have a circle icon to the left of the function name and each variable to be passed to the php code will be declared as type = Object in Flashbuilder. The input types and return types will have to be reconfigured for each non-functioning function. Simply commenting out a portion of the php code and attempting a refresh will not make it work again.
When the wizard is unable to refresh properly because of a stop in the php code it stops working completely so additional refreshes or creation of code is not carried out.
I decided to create a My SQL table for user and other identifiers rather than attempting the session object again.
Sorry, I did not make screen shots as I solved this problem. I hope the solution is not hard to visualize.
Thanks for looking and considering how to help me. I hope my solution works for you. -
Setting remote credentials in services-config.xml
Webservice and remoting calls can be restricted access to
CFC's using usernames and passwords. And to 'authenticate', I'm
having trouble setting the <remote-username> and
<remote-password> elements in the services-config.xml
A remoting fault event is dispatched because the tags
(<remote-username> & <remote-password>) "shouldn't"
be in the <properties> element in the destination definition.
I would rather protect that info on my server than compile it in
the swf inside a setRemoteCredentials call, so why isn't the
example from the docs working?Look at this thread
re:UIX/XML: XSS styleSheets
There is mention of a bug regarding the element to use - <style-sheet> instead of <style-sheet-name>. There might be some other stuff of interest in there as well.
Cheers
Ian -
Tomcat: prefix in services-config.xml must be unique?
Hi all, I've been trying to get my flex application communicating with Tomcat and now have it working
Just trying to confirm something that took me many hours to get right and may help others along the way..
Originally I modified the BlazeDS webapp by updating the remoting xml and putting in my own classes and it worked without any problems
I then removed the BlazeDS webapp directory out the tree and created a new one carefully checking each step.. but there was nothing written to catalina log file at any time when running the app or any sign of communication even in debug mode
I then moved the sample BlazeDS webapp back and when starting Tomcat it complained of duplicate ID's (here is the message: Exception: flex.messaging.config.ConfigurationException: Can not add destination with id 'insert your remoting destination id' to service with id 'proxy-service' because another service with id 'remoting-service' already has a destination with the same id)
Eventually I noticed in services-config.xml logging section for my new webapp that the <prefix> was still set to BlazeDS - changed this to the new webapp directory name and not only did the exceptions disappear but everything now worked
So I'm thinking that the prefix is much more important than just a logging descriptor as the XML tag suggests
Can anyone confirm this behaviour or shed some light?
PS I should make clear the above problems were not when running the turnkey but on a fresh install of tomcat 6.0.29 on Centos linux using apache proxypass/reverseproxypass to redirect port 80 to 8080
PS2 - I realise this is not a pure Flex question but it's related due to Adobe crafting a turnkey Flex/Tomcat install with Blaze and it's in the flex configuration files)
I hope I've covered all bases in the question and look forward to knowing more... CHEERS!Hi all, I've been trying to get my flex application communicating with Tomcat and now have it working
Just trying to confirm something that took me many hours to get right and may help others along the way..
Originally I modified the BlazeDS webapp by updating the remoting xml and putting in my own classes and it worked without any problems
I then removed the BlazeDS webapp directory out the tree and created a new one carefully checking each step.. but there was nothing written to catalina log file at any time when running the app or any sign of communication even in debug mode
I then moved the sample BlazeDS webapp back and when starting Tomcat it complained of duplicate ID's (here is the message: Exception: flex.messaging.config.ConfigurationException: Can not add destination with id 'insert your remoting destination id' to service with id 'proxy-service' because another service with id 'remoting-service' already has a destination with the same id)
Eventually I noticed in services-config.xml logging section for my new webapp that the <prefix> was still set to BlazeDS - changed this to the new webapp directory name and not only did the exceptions disappear but everything now worked
So I'm thinking that the prefix is much more important than just a logging descriptor as the XML tag suggests
Can anyone confirm this behaviour or shed some light?
PS I should make clear the above problems were not when running the turnkey but on a fresh install of tomcat 6.0.29 on Centos linux using apache proxypass/reverseproxypass to redirect port 80 to 8080
PS2 - I realise this is not a pure Flex question but it's related due to Adobe crafting a turnkey Flex/Tomcat install with Blaze and it's in the flex configuration files)
I hope I've covered all bases in the question and look forward to knowing more... CHEERS! -
Clarification on services-config.xml files for RemoteObject services
I am currently preparing an AMFPHP environment for exchanging
data with Flex and AIR applications. I can connect to the services
via Netconnection, but using RemoteObject won't work.
Documentation for the necessary configuration files
(services-config.xml, remoting-config.xml and the like) is, um,
sparse and seems to be slightly incorrect or misleading at times.
So I'm looking for clarification about
changes in the syntax of services-config.xml · in
examples for Flex 2.01, there are "class" attributes with values
beginning with "flex.", in Flex 3 examples the attribute name has
changed to "type", values beginning with "flex." have mostly
vanished and been replaced with similar looking values beginning
with "mx.". Are "flex." and "mx." prefixes interchangable?
correct syntax for linking other files into
services-config.xml · the livedocs state that Adobe
prefers linking files into services-config.xml (using something
like <service-include file-path="remoting-config.xml"/>)
instead of defining all service parameters there. But in the
example from the Flex 2.01 livedocs, the root element of the
service-config.xml file is <services> instead of
<services-config>. Assuming that <services> is meant as
a
child of the <services-config> root element, there
seems to be a mandatory <service> child element missing.
That's either intended, illogical, and misleading, or simply
erroneous.
which classes are still valid in Flex 3, which have changed?
· Most of the examples for using RemoteObjects out there are
for FlexBuilder 2 (e.g.
here)
and don't seem to work with FlexBuilder 3 Beta 2. But there is no
statement to be found in the Flex 3 documentation about what has
changed.
a meaningful example for services-config.xml · In the
Flex 3 Beta 2 documentation here are plenty of references to using
services-config.xml, as I can find even information about the
ServerConfig class in the ActionScript 3 Language Reference, a sort
of wrapper class for the information provided in
service-config.xml, but there is no information about what
constitutes a
working service-config.xml configuration (which XML tags of
what names containing what attributes need to be present).
As I'd really like to create cutting-edge Flex and AIR OCC
applications, I'm eager to have those ambiguities clarified.
Best regards,
CathnessFrom the docs it looks like this is used for web services as
well:
http://livedocs.adobe.com/flex/201/html/dataservices_config_100_3.html#260186
If this isn't the right config file, which file should I be
looking at?
Mike -
Services-config.xml REALLY necessary?
Could somebody please clarify why we need the
"services-config.xml" file when running in the context of Flex
3/AMFPHP?
As near as I can tell, "services-config.xml" MIGHT be a
requirement for running with LiveCycle Data Services, but while I'm
admittedly new at all this, it seems to me to be completely
unnecessary or even detrimental when running with Flex 3 and
AMFPHP. Using the "services-config.xml" file requires that it
compiled into the project which pretty much makes it fixed at run
time. By expressing it programmatically at run time (using AS and
the appropriate property of the RemoteObject; "endpoint" I think it
is...), you open the possibility of being able to read the
appropriate URL from an INI file or something, very handy if you
are installing your SWF on different servers with potentially
different directory structures.
Could somebody please clarify this for me?
And would somebody PLEASE put up a good Flex 3, Flex Builder
3, AMFPHP set of tutorials/examples? Considering how important
accessing backend data is, you would think such examples would be
common as dirt, but they're not. All I can find are a bunch of Flex
2 examples, and the occasional Flex 3 example INSISTS on using
"services-config.xml".
Thanks in advance.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> -
Services-config.xml settings for demo
Hi,
I need set the demo work with <mx:RemoteObject>
http://www.adobe.com/devnet/flex/articles/helloworld.html
I am new and I do not know how to change the
services-config.xml for the demo.Please help me and let me know how
to change the config file.
Thanks
MKHere is an example about coldfusion and cfc's
http://www.kylehayes.info/captivate/QueryToDatagrid/QueryToDataGrid.htm
Rgds
JFB
"mark416" <[email protected]> wrote in
message
news:fcmegj$86$[email protected]..
> Hi,
> I need set the demo work with <mx:RemoteObject>
>
>
http://www.adobe.com/devnet/flex/articles/helloworld.html
>
> I am new and I do not know how to change the
services-config.xml for the
> demo.Please help me and let me know how to change the
config file.
>
> Thanks
>
> MK
>
Maybe you are looking for
-
My ipad 3 froze and now is not turning back on what should i do?
my ipad 3 froze and now is not turning back on what should i do?
-
Please could any one help every time i try to burn cds it comes up with error code 4261. Its driving me crazy. Ive tried changing the speed but no luck also renstalled itunes.
-
Can we invoke POV for Date field. I have a date field and depending upon the Transaction F4 help should come. In one transaction i have to get Calender and others the Dates from Ztables have to appear. Is it possible to invoke calender implicitly.
-
Batch or script..plug-in?
Hopefully somebody can help me with this question! Will try to explain it as simple as possible; I have a folder with for instance 60 files. In this folder are always three files that I want to combine in one PSD. The three files are bracketed pictur
-
Plant Replication Classic Scenario SRM 3.0
Hi, would anyone remember the report to replicate plants from R/3 into SRM in SRM 3.0 In 4.0 / 5.0 it is BBP_LOCATIONS_GET_ALL OR BBP_LOCATIONS_GET_FROM_SYSTEM But these so not exists in SRM 3.0 This is urgent. Regards, Rahul