Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

consumer subscribe failure. reason:type is text/html?

Avatar

Level 1

In the data push sample "feed", every thing is ok. I copy the source to my own project, but I couldn't work.

In the sample project, when I click the <Subscribe to 'feed' destionation> button, I catch the Http content, and the type is like this:

  "application/x-amf>".

But to my own projectm, when I click the <Subscribe to 'feed' destionation> button,the Http type is like this:

  "text/html;charset=utf-8".

I think the difference is the reason of this problem.

Source is very simple. Like this:

-----------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#FFFFFF">
    <mx:Script>
        <![CDATA[           
            import mx.messaging.messages.IMessage;
            private function messageHandler(message:IMessage):void
            {
                pushedValue.text = ""+ message.body;   
            }
        ]]>
    </mx:Script>
    <mx:Consumer id="consumer" destination="feed" message="messageHandler(event.message)"/>
    <mx:Button label="Subscribe to 'feed' destination" click="consumer.subscribe()" enabled="{!consumer.subscribed}"/>
    <mx:Button label="Unsubscribe from 'feed' destination" click="consumer.unsubscribe()" enabled="{consumer.subscribed}"/>
    <mx:TextInput id="pushedValue"/>
</mx:Application>

-----------------------------------------------------------------------------------------------------------------------------------------------------------

1 Reply

Avatar

Level 1

There is something wrong in the problem description. I should continue find the true reason.