Ok, this may seem like a stupid question (for Flash Developers) but I really can't figure this out.
So, I want to create somekind of an API for Flash/Flex applications so a user can use my lib in order to connect to my WebOrb Rails server.
I don't have any problem with the rails part but things get a little bit difficult with the flash part.
So, I saw from the example that Flex is using the RemoteObject to connect/retrieve data.
The question is how can I create a Flash file that connects/retrieves data from WebOrb (i couldn't find the RemoteObject - is an include I should make?).
If that is not possible, can I create some sort of library in Flex, that can be linked in Flash in order to achieve the same result?
Thx
What you're looking for is most likely the NetConnection Actionscript class. Depends on the format of your API though. If it's just XML over HTTP, you could easily just use the URLLoader class as well.
NetConnection
link text
URLLoader
link text
Related
I have a java server side project which contains JAX-WS web-services (using JavaEE 6 and the #WebService annotation).
Is there some kind of plugin that would allow me to generate Flex client stubs during my maven build ?
I have taken a look at enunciate, but it seems to generate only AMF client.
I've also tried to look at GraniteDS, but their doc seems a little opaque to me.
Notice my Flex project is compiled using flexmojos, which contains a flexmojos:generate mojo that should be able to generate domain object (however I don't understand how to say it to use domain classes from ANOTHER project, and not from a different folder).
So, is there any maven plugin that would allow the kind of feature described in this Adobe page ?
Well most solutions use the WebServices WSDL description and generate stuff from that.
I documented this process in my Wiki. Don't be confused about the CXF Part, just have a look at the "Seting Flex up as Web Service client" part. When I did this, I used the code generation features of Flash Builder to generate the code and to work with that code.
I know this is not the cleanest way to do it, but it worked then (about 2 Years ago). Things like wsld2as weren't available then ... perhaps you should have a look at that.
I am looking for approaches I can take to consume my .net SOAP service on the BlackBerry Playbook. So far I believe there are two main approaches to my problem.
Apache CXF wsdl2js
I have used wsdl2js to generate the javascript needed to communicate with the service. However I end up getting a http 500 error and have not been able to get past that. I have looked through the provided examples from the Apache CXF download and I have done some searching and cannot find a solid example of creating the javascript client. A lot of examples seem to somehow access the wsdl file at runtime from a server but my javascript is already generated from the CXF tool and I just include the scripts... if anyone has some tips here that would be great.
Adobe Flex and AS3
Another option I have considered is using Adobe Flex. I create a new Mobile Flex project in Flash Builder using the BlackBerry PlayBook SDK and Flex 4.5. However when I use the menu options to connect to a web service I get prompted with "This option is only available for flex projects."
Are there any other options out there that provide a solution to this problem? If you need more information just let me know.I understand this is a large topic, thank you for your time.
In Flex, you can use the WebService class to access SOAP WebServices. More info here.. I'm sure you can use this class for a non-Flex AS3 solution.
I'm not sure why they disable the Flash Builder tooling for this; but it shouldn't prevent you from using the actual classes to access WebServices.
I can't speak about the alternate approaches.
I need to send files securely from Adobe Air. In any other language, my first thought would be sftp/scp, but I don't see any libraries to do that in Flex.
I'm new to flex, so I'm not sure where to look for code examples and repos. It looks like the raw socket interface is available, so I could write one if no good examples exist. Of course, I'm trying to avoid that.
There was an action script ftp project, but it seems to be no longer maintained. You can take a look here, maybe you can reuse some code.
Let me start off by stating that I am a novice developer, so please excuse the elementary nature of my question(s).
I am currently working on a Flex Application, and am getting more and more confused about when to use server side scripting, and when to develop web services. For most of the functionality I am working on, I am taking various files from the user (client), uploading to the server for processing/conversion, then sending back to client in new format.
I am accomplishing most of this using asp.net generic handlers (ashx) files, but not very confident this is best practice. But at the same time, does making web services make any more sense? What would be considered best practice for this? Any suggestions would be greatly appreciated.
The way I look at it is as follows:
Web Services mean Established Best Practice.
For most of our development, we don't need to create "Web Services", or what I'm thinking when I think REST, SOAP, and the Twitter API. You only need to start doing that once you've got something you're going to be using every day for years.
Clean and DRY code will Lead you to Creating a Web Service
If you spend the time to clearly define the parts of your upload-process-render Architecture, and you find that it can be applied to almost everything you are doing, then all you need to do to make it a Web Service is define a clear, 1-2-3 set of rules for using the system (GET/POST data, etc.). As long as you are consciously building an architecture the whole way, you'll end up creating a Web Service if it's worthy. Otherwise there's no need.
It sounds like you have a clear workflow going, I don't know anything about asp.net though.
As far as it being confusing sometimes, and best practices, I suggest the following:
Create a Flex Library Project for your "generic ashx file handling" Flex classes. Give it a cool, simple name.
Create a .NET Library Project that encapsulates all the logic for your server-side file processing. Host it online and make it open source. I recommend github. Test it as you go, and document it, its purpose and the theory behind it.
If you don't have to do anymore work at this point, and it's just plug and chug, then you've probably arrived at something that might become a Web Service, though that's probably a few years down the road.
I don't think you should try to create a Web Service right off the bat. Just make some clean and reusable code, make a few examples, get it online and open source, have others contribute and give feedback, and if it solves a specific problem, then make it a web service. You can just use REST for now probably, and build your system around that. RestfulX is a great library for that.
Best,
Lance
making web services without any sense make no sense ;)
Now in the world of FLEX as3 with flash version 10, you can easily read local files, modify them with whatever modifcation algorithm and save local files without pinging server.
You only have to use webservices if you want to get some server data or to send some data to server. that's all.
RSTanvir
Flash / Flex uses a simple HTTP POST approach for file uploads, so trying to do that using SOAP web services will be problematic. Your approach of using ASHX here sounds reasonable to me.
To send / receive data that isn't file based (e.g. a list of files the user has uploaded previously), I would recommend looking at the open source Fluorine FX library. Fluorine uses AMF which is a highly performant way of doing data transfer with Flash. It's also purely configuration-based, which means you don't need to code against any of its APIs, just configure Fluorine to expose your .NET service classes. You could easily add attributes to those same classes to expose them as SOAP web services via WCF if you need that in the future. I would not recommend using SOAP with Flex however, due to the performance losses and also because the Flex implementation of SOAP has a history of bugs and interoperability problems.
I am wondering if there is any codes sample for ASP.NET with Voice recording.
Ok, Basically, i want to create a web page that allow user to click a record button and record his voice thru his/her microphone and then convert it into mp3 file, then i want to click PLAY button to play what was recorded.
I have searched google alot and cannot find any codes that code do just that.
I have seen site that can do just that and it is using FLASH with RoR (i think).
Is there any way to record voice using ASP.NET?
I dont care if it need to combine with FLASH with ASP.NET, as long as it is possible.
Thanks.
EDIT:
Stephen M. Redd,
Appreciate your input. Yes, i know there is no simple way to accomplish what i am asking for. I also have researched and google alot on this question. Yes,I have come to know the best way to do this is through using FLASH with either FMS or RED5 (open source).
So i am trying to figure out how to write a simple FLASH (.swf) that i can record voice and then save into mp3 format to RED5 server.
Do you know or can you provide any directions to what i am asking above?
1) Tutorial on Microphone class in FLASH (i am reading some basic implementation from a book called "FLASH Actionscript in a classroom", which doesnt tell me how to record voice but ONLY how to use microphone object in FLASH)
2) Tutorial on how to setup and use RED5 (FMS is NOT an option due to its cost)
3) how to integrate 1) and 2) with asp.net and javascript (if there is any flashvars that the FLASH microphon .swf i can access so that ASP.NET can be used with javascript)
Thanks.
EDIT 2:
I cant consider to accept an answer BECAUSE none of them has provided a good answer.
Take a look on my question and read the comments i got, and you will see that my question was NOT being provided a good answer.
My question is to find a web-based Audio/Voice recorder so that the users can record their voice on the site.
To better convey what i exactly asked for, take a look at www.snapvine.com or www.pubclip.com . Both of them provide a way for users to record their voice right on the webpage.
So, i am looking for a FLASH component (.swf) similar to what they offer to integrate with my site.
EDIT 3:
This voice/microphone recording thing seem to be a challenging project for most developers.
I guess this means i am all alone.
I think this is something that would have to be done with Flash.
This guy appears to have some examples of doing voice recording in Flash, with code samples:
http://fms.denniehoopingarner.com/
There is no simple way to do this kind of thing. Standard web technologies based on HTTP and HTML just don't have the features. HTTP doesn't work well with moving audio data, and HTML and Javascript are not able to talk directly to the hosting OS or hardware resources like the microphone.
There are 3rd party browser plug-ins and applets that you may be able to use via a web application to do this kind of thing.
Most people use Flash and the Flash Media Server to do audio input via the web.
There are also some Java applets that have similar capabilities such as the ListenUp SDK (I have not used this, so it isn't an endorsement).
There is a lot of discussion on this topic related to Microsoft Silverlight, but as I understand it voice and camera inputs from the client side are not supported as of Silverlight 2, though it may get put into Silverlight 3. There is a good bit of information about how to use the necessary Flash bits within a Silverlight application though. For more info on that, check out this post.
ASP.net is a Server-Side Technology, but voice recording is done Client side. So regardless if you use ASP.net, PHP, Ruby on Rails or Cobol, you can't do it directly.
What you need is a Client-Side Application that works together with the Server Side to accomplish this. I do not know if Silverlight can do Microphone recording, but Flash can. This is apparently quite easy using the Flash Media Interactive Server, but normally you should be able to do this without, i.e. just by having a Flash Application doing the recording and then Uploading it to the server.
Hi Sam in Silverlight 4 it is possible to record voice from microphone and webcams.
Just follow the blog.
http://blog.ondrejsv.com/post/Audio-recorder-Silverlight-4-sample.aspx
Good Luck