# How can I put result of getPublishedStreamNames() to AMFDataMixedArray

**URL:** <https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [February 17, 2011, 12:33pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097 "2011-02-17T12:33:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Lee](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@John\_Lee](https://community.wowza.com/u/John_Lee)\
**Post date:** [February 17, 2011, 12:33pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097/1 "2011-02-17T12:33:35Z")

</div>

Hi,

It should be a silly question, but I am desperate with my complete lack of Java experience.

I have searched forum and modified ModuleVideoNameList to get published live streams names using ApplicationInstance.getPublishStreamNames().

But I don’t know how to put List into AMFDataMixedArray.

I need some help here.

-John

```auto
import com.wowza.wms.amf.AMFDataList;
import com.wowza.wms.amf.AMFDataMixedArray;
import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.client.IClient;
import com.wowza.wms.module.ModuleBase;
import com.wowza.wms.request.RequestFunction;
public class GetPublishedStreamNames extends ModuleBase {
	AMFDataMixedArray publishedStreams = new AMFDataMixedArray(); 
	
	
	public void getStreamNames(IClient client, RequestFunction function, AMFDataList params) {
		getLogger().info("getFiles"); 
		publishedStreams = new AMFDataMixedArray();
		IApplicationInstance app = client.getAppInstance(); 
		
		publishedStreams = app.getPublishStreamNames();
		sendResult(client, params, publishedStreams);
	}
}

```

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 17, 2011, 7:44pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097/2 "2011-02-17T19:44:09Z")

</div>

Wowza

```auto
package com.wowza.wms.example.module;

import java.util.*;
import com.wowza.wms.amf.AMFDataList;
import com.wowza.wms.amf.AMFDataMixedArray;
import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.client.IClient;
import com.wowza.wms.module.ModuleBase;
import com.wowza.wms.request.RequestFunction;

public class ModuleGetPublishedStreamNames extends ModuleBase {

        public void getStreamNames(IClient client, RequestFunction function, AMFDataList params) {
            getLogger().info("getFiles");
            AMFDataObj publishedStreams = new AMFDataObj();
            IApplicationInstance app = client.getAppInstance();

            List<String> streams = app.getStreams().getPublishStreamNames();
            Iterator<String> iter = streams.iterator();
		while(iter.hasNext())
		{
			String streamName = iter.next();
			publishedStreams.put(streamName, streamName);
		}
            sendResult(client, params, publishedStreams);
    }
}

```

Flash client-side:

```auto
public function getStreamNames():void
		{
			if (nc==null)
				return;
			
			nc.call("getStreamNames",streamNameResponder);
		}
		private var streamNameResponder:flash.net.Responder = new flash.net.Responder(function(ret:Object):void
		{
			for (var prop:String in ret)
			{
				trace(" "+prop + " = " + ret[prop]);
			}
			
		});

```

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 17, 2011, 8:42pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097/3 "2011-02-17T20:42:57Z")

</div>

John,

I updated the example Module. Here is the client-side of it:

```auto
public function getStreamNames():void
		{
			if (nc==null)
				return;
			
			nc.call("getStreamNames",streamNameResponder);
		}
		private var streamNameResponder:flash.net.Responder = new flash.net.Responder(function(ret:Object):void
		{
			for (var prop:String in ret)
			{
				trace(" "+prop + " = " + ret[prop]);
			}
			
		});

```

Richard

---

<div class="post-metadata">

**Author:** ![John\_Lee](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@John\_Lee](https://community.wowza.com/u/John_Lee)\
**Post date:** [February 17, 2011, 12:51pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097/4 "2011-02-17T12:51:15Z")

</div>

It works!

Thanks

---

<div class="post-metadata">

**Author:** ![John\_Lee](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@John\_Lee](https://community.wowza.com/u/John_Lee)\
**Post date:** [February 17, 2011, 1:18pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097/5 "2011-02-17T13:18:35Z")

</div>

Richard,

It worked but only returns one stream name instead of all three streams.

It looks like returning only last streams name element of from getPublishedStreamNames.

I can see all three stream names in ‘stream’ object in the debugger.

Is there anything I am missing?

-John

---

<div class="post-metadata">

**Author:** ![John\_Lee](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@John\_Lee](https://community.wowza.com/u/John_Lee)\
**Post date:** [February 17, 2011, 1:49pm UTC](https://community.wowza.com/t/how-can-i-put-result-of-getpublishedstreamnames-to-amfdatamixedarray/36097/6 "2011-02-17T13:49:31Z")

</div>

Thank you. It finally worked.
