red5: can i make shared objects read only on the client side? - apache-flex

I'm using shared objects for a chat application, but i want my red5 to monitor every string that comes in. how can i make sure that the client side won't be able to modify the shared objects ?
In my case the client side is written using adobe flash builder beta 2 (flex4)
thanks!

seems that i need to use registerSharedObjectSecurity
http://dl.fancycode.com/red5/api/org/red5/server/adapter/MultiThreadedApplicationAdapter.html#registerSharedObjectSecurity%28org.red5.server.api.so.ISharedObjectSecurity%29
to register a ISharedObjectSecurity class with restrictions to my shared object.
http://dl.fancycode.com/red5/api/org/red5/server/api/so/ISharedObjectSecurity.html
gonna post a full answer while i'll test it.

Related

Is There a way to resume a download using Flurl framework?

I am using the Flurl framework to call web service methods.
One of this method returns a file content as a Stream using FileStreamActionResult as a return value of my web service.
On the client side I am using the DownloadFileAsync extension method implemented in Flurl.
All is working good..
Now in case of very big file, I want the process to be able to resume at a point where the download could have been stopped (because loose of network...or even because the user has closed the app).
Is this possible with Flurl ?
Regards.
No, Flurl doesn't provide that functionality.

ASP.Net How to call an Unknown (Dynamic) WSDL Webservice and parse it's result?

will appreciate any pointers here. This scenario may sound a bit weird:
I am trying to write a program that consume webservices that user define, and that my program do not know in advance.
For example, my program allow users to set/define all the webservices that they have in their network, into my database.
My program will then show a list of all the webservices that users have defined, and with a click, my program will call THAT webservice (with the parameters that use can key in) and then my program will show the result (string).
Problem is that at design time, I have no idea what are the webservices and the parameters and response. So, I need to dynamically create some sort of a stub that can consume these webservices without having to Add-Reference into my project in advance.
Will appreciate any pointers here.
Sounds like you're trying to build your own SOAP_UI here :) (excellent tool for testing purpose on Webservices) , correct ?
I guess you'd want to play with wsdl.exe.

Only one instance of object for all visitors?

I have a dedicated server with a Skype client running on it. I intend to use the Skype COM API to make an AJAX-based live-chat on my website.
However, for this to work, I need an object to be initialized only once for all visitors, and I need to be able to use that very same object across visitors too. How can this be done?
maybe you can put it on your application
System.Web.HttpApplication
class and instance it on
Application_Start()
or
Application_Init()
You are looking for a singleton pattern. However you will get global state, it would probably better to share the chat messages using a database of some sort. Global state is tricky to test.
I ended up using the Application["keyhere"] object to simulate singleton properly.

Best practice when working with web services that return objects?

I'm currently working with web services that return objects such as a list of files e.g. File array.
I wanted to know whether its best practice to bind this type of object directly to my front end code for example a repeater/listview or whether to first parse it into my own list of "file class" e.g. customFiles[]
If the web service changes then it will break my front end code, however if I create my own CustomFile class, then i would only need to change my code in one place to fix the issue, but it just seems like a lot of extra work to create the same classes from a web service, i wanted to know what is the best practice for this type of work.
There is a delicate balancing act in properly encapsulating implementation details. Too little encapsulation is a maintenance nightmare as small changes in any area break the application. Too many layers is a different kind of maintenance headache altogether.
In this particular case I would create a small layer in your application to encapsulate the web service calls. This will ease your maintenance in both the application and the service as they will be loosely coupled.
It sounds like you have already answered your own problem. Best practice is to create your own custom class for the reasons you point out, but it is significant extra work.
If the webservice isn't likely to change then just use the existing classes, but if you need to cater for change then create your own.
Returning a class is fine as long as your client knows how to deserialize it. If it's truly a web service, where you don't have control over both ends of the conversation, it's more common to start with schemas for XML request and response streams. That decouples the client from the web service a bit more and allows any client that can send XML via HTTP and consume an XML response fair game.

can asp.net access flash shared object?

I'm looking for a direct way for server-side code to access a flash shared object. Obviously you can write some javascript that can read flash shared objects via ExternalInterface. But doing that requires a client code execution, and then a push of the shared object data back to the server-side code. This seems rather complicated.
So is there a way for asp.net, php, or any other server-side script to request the data in a flash shared object?
Hope this question makes sense. Thanks!
Flash is a client side runtime.
Therefore, you require some client side code execution to get the values out of it.
Javascript is as good an option as you'll get (without having the Flash app phone home itself).

Resources