How to deploy SWF file to Websphere application server? - apache-flex

I want to deploy my application coded in FLEX to my WAS 7.0.0.4 on localhost. The application is exported as a SWF file. But I don't have got any experience with WAS and I didn't find any tutorial how to do that and that whole system looks really confuzing to me. Could somebody write step-by-step solution or give me any advice how to reach my object?

If I understand you correctly, you'd probably be better off just using an HTTP server like Apache or IBM HTTP Server (which is much the same thing). It sounds like you're deploying static content (from the server's perspective), so an application server will only add complexity and use more resources without providing you with any additional functionality. On an HTTP server, all you need to do is place the files you want to deliver to the browser in a specific directory.

Related

Mobile App Using Remote Web Server

I must say that I am reaching the end of my tether with Flash Builder and Flex. Firstly, I have built this wonderful app that I want to start using but it is data driven meaning that when I built it, I created it on my localhost. The PHP scripts were generated from Flash Builder and I have edited them to make them more secure. I have all my services working 100% and I have this brilliant app, but I can only run it on localhost. I have done everything necessary and installed Zend Framework on both servers, I have configured Zend properly but I cannot work out how to change the mobile app to now read from my remote web server.
To me this is useless as I want to be able to deploy this app to others to use when they are out and about.
Does anyone have any clue whatsoever as to how to change it from looking at a localhost to looking to my remote web host? Any tutorials or anything that you can think of? Any help would be appreciated.
Does anyone have any clue whatsoever as to how to change it from
looking at a localhost to looking to my remote web host?
Usually, I don't have to do anything. It just works. But, for some reason, the "first migration" from localhost to production seems to be hard for every Flex developer. Here are some things I wrote about that frustrated me.
Before moving forward; I'll add that your post is inherently confusing. You talk about running your app on localhost; but you also talk about building mobile apps. Were you building a native mobile app? If so; how are you running it on localhost? Mobile Native Apps don't run on a local web server; they run in an emulator.
The rest of this post assumes you are building a browser based app, but even if not should give you some good debugging tips.
Most likely you did something ignorantly which is preventing things from working. Once you figure it out you'll never have the problem again. So, here are some things to check:
It sounds like you have URLs hard coded somewhere within your app that point to localhost. I'd look for that first.
If you're using AMF with RemoteObject; it may be in your services-config file that is hard coded into your app. Be sure to check that if you are compiling a services-config into your app.
Beyond that, it is possible that your remote server is not configured properly. When using ColdFusion we have a special URL ( localhost/flex2gateway ) that we can check to verify that Flash Remoting is set up properly. I'm not sure about PHP, but I bet it is something similar.
You didn't tell us your specific setup, but if you're using a locahost SWF with services on you remote server, your remote server will need a crossdomain.xml file to allow the "off-server" access.
You didn't tell us your specific error, which makes it hard to provide more information. But, be sure to test your services--outside of the Flex app--to make sure they don't have remote errors. Be sure to check case sensitivity of URLs on your localhost vs your server. Be sure to use a Network Sniffer such as the Flash Builder Network Monitor to or ServiceCapture or Charles to check the traffic being sent from the browser/Flash Player to your server. You may discover errors that way.

deploying flex applications

I have a Flex application which has to be deployed in some server. The typical form of access would be invoking the URL. How do i go about it?
Should I have multiple instances of the applications running on the same server/ deploying the application in diff servers and using a load balancer for routing?
If i must have multiple instances, how to do that?
On a given day, the application is expected to get around 2000-3000 hits. What are all the factors to be kept in mind while deployment?
Any pointers would be helpful.
thanks.
I'm actually a bit unsure what specifically you're asking, so I'll take your questions one by one.
I have a Flex application which has to
be deployed in some server. The
typical form of access would be
invoking the URL. How do i go about
it?
Put your SWF files on a web server. For best results export a release build first. Flash Builder makes this easy.
Should I have multiple instances of
the applications running on the same
server/ deploying the application in
diff servers and using a load balancer
for routing?
Probably not, but it depends. A SWF is just a binary asset. As far as the server is concerned it is no different from a JPG, gif, or PNG file. Whether or not you need a load balancer to serve the SWF depends on the size of the SWF, the amount of simultaneous hits you expect, other traffic on the server, bandwidth of your hosting provider, and probably a whole slew of other considerations that escape me at the moment.
If your SWF is making calls to the server--very common in Flex Applications--that may also be a consideration.
If i must have multiple instances, how
to do that?
If you have multiple instances of what? Of the SWF? Why would you need to do that? As I said, as far as the server is concerned a SWF is just a binary asset. In theory you could keep as many copies of the file on your server as you want, in practice most people just use a single one.
On a given day, the application is
expected to get around 2000-3000 hits.
What are all the factors to be kept in
mind while deployment? Any pointers
would be helpful.
That strikes me as low traffic site; however it depends what you're doing.
Despite my answer, I have to vote to close as your questions is vague and ambiguous. I'm not sure what you want to know.
I think you miss a basic information on your application.
As long as you create Flex/Flash application and you put them on your server they will always be SWF file executed Client Side.
So i think you don't have to wonder on the workload of your server because isn't your server that run the application but the Client PC.
As long as your server can manage 2000/3000 hit per day you can be quite sure that alway will run smootly.
Claudio.

Web application configuration settings - Which is the better place to store

I came across a case study few days early. It is related to a web application architecture.
Here is the scenario,
There is a single web service used by say 1000 web applications. This web service is hosted on a particular server. If web service hosting location is changed, how the other applications come to know about this change ?
Keeping it in web.config doesn't seems to be a feasible solution as we need to modify web.config files for all the applications.
Keeping these settings in a common repository and let all the applications use it for web-service address was came in my mind, but again there is a question of storing this common repository.
I am just curious to know about how this could be achieved with better performance.
Thanks in advance for any kind of suggestions.
do you have full access or control over all those web applications consuming that web service? if so, you could have a script or some custom code which updates all their web.config(s) at once. it seems too much work but in fact in this way you have more control and you could also, eventually, point to the new url only some applications and leave some others on another url.
the idea with the setting in a centralized database gives you faster update propagation which could also be bad in case of errors and then you have all applications referring to the same place and no way to split this. Then you have anyway to connect to a centralized database from all of them and maybe you should add a key to their web.config(s) with the connection string to that database, then, in case that database is not reachable or is down, the web applications will not be able to consume the web service simply because they cannot get the url of it.
I would go for the web config, eventually you could have a settings helper class that abstract the retrieval of that url so the UI or front end does not know from where that url comes from.
anyway, do you plan to change the url of a web service often? wouldn't be better to copy it to a new url but to also keep it available on the current url for a while?
another advantage of web.config approach is that everytime you update and save it the application is restarted while a change in a database might take a while to be detected in case you have some caching mechanism,
hope this helps.
Davide.

ASP.NET AJAX JavaScript files served from a static location

I realise that this is going to be a fairly niche requirement and will almost certainly raise a few "WTF's" but here goes...
Within an ASP.NET Webforms application I need to serve static content from a local client machine in order to reduce up-front bandwidth requirements as much as possible (Security policy has disabled all Browser caching). The idea is to serve CSS, images and JavaScript files from a location on the local file system referenced by filesystem links from within the Web application (Yes, I know, WTF's galore but that's how it is). The application itself will effectively be an Intranet app that's hosted externally from a client but restricted by IP range along with standard username/password security. So it's pretty much a hybrid Internet/Intranet application but we can easily roll out packages of files to client machines. I am not suggesting that we expect nor require public clients to download packages of files. We have control to an extent over the client machines in terms of the local filesystem and so on but we cannot change the caching policy.
We're using UpdatePanel controls to perform partial page updates which obviously means that we need to Microsoft AJAX JavaScript files. Presently these are being served (as standard) by a standard resource handler within IIS/ASP.NET. Ideally I would like to be able to take these JS files and reference them statically from a client machine, and no longer serve them via an AXD.
My questions are:Is this possible?If it is possible, how do we go about doing so?
In order to attempt to pre-empt some WTF's the requirement stems from attempting to service a requirement with as little time and effort as possible whilst a more suitable solution is developed. I'm aware that we can lighten the load, we can switch to jQuery AJAX updates, we can rewrite the front-end in MVC etc. but my question is related to what we can quickly deploy with our existing application architecture.
Many thanks in advance :)
Lorna,
maybe your security team is going crazy. What is the difference between serving a dynamic HTML generated by the server and a dynamic JS generated by the server?
It does not make any sense. You should try talking them out of it.
what is the average size of pages and viewstate data. you might need to store viewstate in sqlserver rather than sending it to client browser every time.

How to write an offline version of an AJAX/ASP.NET web application

We have a web application that uses AJAX to talk to an ASP.NET web service. We would like to write another version that can be used offline. We need to be able to re-use our existing code as much as possible. What approaches should we consider?
The app is currently using XmlHttpRequest to get dynamic data from the server. Obviously the offline version will not be able to talk to the server, but it does need to talk to something! I'm sure installing IIS or Cassini on the client would work, but I was hoping for a simpler solution. Is there no other way for JavaScript to talk to some external code?
There are plenty offline web apps nowaday. It simply evolve from AJAX.
For example:
WoaS (wiki on a stick / stickwiki), Tiddly Wiki,
Google doc and Gmail is going to be offline.
You don't need a webserver to run these webapps in offline mode. Just store the required data, scripts on the client side (usually as XML).
One of the possibilities would be to use Cassini. This is a web server that acts as a host for the ASP.Net runtime. You can host Cassini in a Windows application or a Windows Service. In this scenario you do not have to rewrite the web app and the web service.
Most other solutions do require a rewrite of both your web app and your web service. Depending on the way you have written the existing app you can reuse more or less code.
Have you considered HTML5 with application cache and offline storage?
If you hope to create an "offline" version of your package your biggest issue by far will be the need to install your site into a local copy of IIS (registering a virtual directory, etc.). I pursued this briefly a few years ago and gave up in frustration. It can be done: a number of software vendors such as DevExpress do this so you have local copies of their demonstration projects. Indeed, I was able to do this. The problem was the classic "it works on my computer" syndrome. There was simply no way to guarantee that most of my end-users had anywhere near the technical proficiency to make this work.
Thus, I would strongly recommend that you not pursue this path unless you have very technically proficient users and a huge support staff.
But there is one more very important question: did you abstract all data access code to a DAL? If not, then you have a lot of work to do in managing data access as well.
Update: user "Rine" has recommended Cassini. I just wanted to let you know that I pursued Cassini and another 3rd-party web server as well. I think that there are licensing issues with Cassini but may be wrong - it has been awhile. However, I do distinctly remember running into barrier after barrier with this approach and very little documentation to help me out.
if you want a web application run offline, you need a webserver (IIS for ASP) bound to the localhost (127.0.0.1) address. After this so can access your web application by typing http://127.0.0.1/ in your web browser the same way as you do online.
If your AJAX relies on XMLHttpRequest's, you can:
Make the static versions of XML's you get over XMLHttpRequest and put then into a folder on disk.
Rewrite your XMLHttpRequest URL's so that they point to files on disk.
Rewrite your XMLHttpRequest's so that they don't check status (it's always 0 for the file:// protocol.
All JScript works on file:// pages as well as on http:// ones.
Of course it's not the best way to develop static pages, but it may save you some time on rewriting.
I havent come across any framework specifically built for asp.net like the ones available for PHP or RoR.
Here is a good article by Steven to get you started with HTML 5 and ASP.Net Creating HTML 5 Offline application
Obviously the offline version will not be able to talk to the server, but it does need to talk to something!
Enter HTML5 LocalStorage. It works like a database and enables you to put data on your client. Indeed you have to rework parts of your code in javascript and transmit it to the client, but then it would work offline.
Local Storage works like this:
- Setter: window.localStorage.setItem(KEY, VALUE)
- Getter: window.localStorage.getItem(KEY)
- Remove: window.localStorage.removeItem(KEY)
To get the main page working offline you need to create a manifest. This is used to store complete sites on the client. Please refer to this for more information about manifests:
http://diveintohtml5.info/offline.html
You want to build a web application to work offline?? It can't be done.
You could split the interface code from the rest (in diferent dlls) and create a windows application to mimic the behaviour of your web application. This way you have 2 distinct user interfaces but the same code for business rules and data access.
I don't really see any other way...

Resources