DataServices JavaScript Client – HelloWorld Messaging

Let’s continue exploring the new DataServices JavaScript Client. This time, we write a simple HTML/JavaScript chat application that talk to other Flex/Flash based chat applications using DataServices.

If you want to run the HTML/JavaScript chat sample, put Chat.html next to Chat.swf along with dataservices-client.js that’s under resources/client-sdk/javascript folder of DataServices installation.

9 thoughts on “DataServices JavaScript Client – HelloWorld Messaging

  1. Hello Mete,

    Nice example but this isn’t working for me.
    I have put your code in to my HTML page and also include the Javascript in this page but its not working for me. It just shows the fault alert message.
    Can you please help me to solve this issue.
    One more thing, In this example you have used dataservices-client.js file but u can’t find in to that location which you have mention but in that folder i have found flex-messaging-client.js file. so i have included that file in to my HTML page.


  2. You need to define my-polling-amf as the channel of the destination in messaging-config.xml, did you do that? Also, are you sure you are using the latest preview build of DataServices? In earlier previews, we had flex-messaging-client.js but then we renamed that to dataservices-client.js in the later ones. So please make sure you download the latest one from Adobe Labs.

  3. Hello Mete,

    Thanks for your reply. Its working now. I haven’t add channels in to the destination. After adding the channels in to the destination, its work for me. I have old version but its also work fine with the old version of ADEP.


  4. Hello mete,

    I have made chat application in the Flex and i am using rtmp channel but this application only works on the RTMP channel, it isn’t work on any other channel. Is it possible to use any other channel in this chat application ? If yes, How? I have add all the channels in to the destination.

    I also want to know, Can we use MultiTopicConsumer / MultiTopicProducer in to the chat application ?


    1. Yes, you can use any channel you want with this application. First, you need to find the destination in messaging-config.xml and add the channel (or a list of channels) to the destination. This way, you can have the destination accept requests from multiple channels. Second, from the client, you need to create a Channel (other than rtmp), add to ChannelSet, and set it to Producer/Consumer. See the sample code I provided.

      Yep, MultiTopicConsumer/Producer are supported in all clients, so you can use them for sure.

      1. Hello Mete,

        Thanks for your support.

        Its work fine now. I can use any channel for the chat application.
        Yes, MultiTopicConsumer/Producer is supported in to the application. Actually i haven’t add “true” this attribute in the messaging config ‘s destination. After adding it, its work for me fine.


    1. Yes, DataServices 4.6 comes with Android and iOS client SDKs, so you can write the same app for Android and iOS as well natively. I’ll try to get an Android sample together and post it here.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s