移动应用使用远程Web服务器 [英] Mobile App Using Remote Web Server

查看:242
本文介绍了移动应用使用远程Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须说,我正在使用Flash Builder和Flex来完成我的系列任务。首先,我已经构建了我想开始使用的这个美妙的应用程序,但它是数据驱动的,意味着当我创建它时,我在本地主机上创建了它。 PHP脚本是从Flash Builder生成的,我已经编辑它们以使它们更安全。我有我的所有服务工作100%,我有这个辉煌的应用程序,但我只能在本地运行它。我已经完成了所有必要的工作,并在两台服务器上都安装了Zend Framework,我已经正确配置了Zend,但是我不知道如何更改移动应用程序,以便从远程Web服务器上读取。



对于我来说,这是无用的,因为我希望能够将这个应用程序部署到其他人使用,当他们出去和约。



有没有人有任何线索至于如何改变它从看本地主机到我的远程Web主机?任何教程或任何你能想到的?任何帮助,将不胜感激。

解决方案


有没有人有任何线索如何改变它从
看本地主机到我的远程web主机?

通常,我不必做任何事情。它只是工作。但是,由于某种原因,从本地主机到生产的第一次迁移对于每个Flex开发者来说似乎都很难。 以下是一些我写了关于这令我沮丧的。。我会补充说,你的帖子本质上是令人困惑的。你谈论在本地主机上运行你的应用程序;但你也谈论建设移动应用程序。你是在建立一个本地的移动应用程序?如果是这样;你如何在本地主机上运行它?移动本地应用程序不在本地Web服务器上运行;他们运行在模拟器中。



这篇文章的其余部分假定你正在构建一个基于浏览器的应用程序,但即使不应该给你一些很好的调试技巧。 >

很可能你做了一些无知的事情,从而阻碍了事情的发展。一旦你弄清楚了,你永远不会再有问题了。所以,这里有一些事情要检查:

这听起来像你的网址硬编码在你的应用程序指向本地主机的地方。我会先找那个

如果您在RemoteObject中使用AMF,它可能在您的服务配置文件,硬编码到您的应用程序。一定要检查,如果你正在编译一个服务配置到你的应用程序。



除此之外,您的远程服务器可能没有正确配置。当使用ColdFusion时,我们有一个特殊的URL(localhost / flex2gateway),我们可以检查以确认Flash Remoting已正确设置。我不确定PHP,但我敢打赌,这是类似的东西。

您没有告诉我们您的特定设置,但是如果您在远程服务器上使用了locahost SWF和服务,则远程服务器将需要一个crossdomain.xml文件以允许关闭服务器访问。



您没有告诉我们您的具体错误,这使得很难提供更多的信息。但是,一定要在Flex应用程序之外测试您的服务,以确保它们没有远程错误。请务必检查本地主机上的URL与您的服务器的区分大小写。请务必使用网络嗅探器(如Flash Builder网络监视器)或ServiceCapture或Charles来检查从浏览器/ Flash Player发送到您的服务器的流量。您可能会发现错误。


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.

这篇关于移动应用使用远程Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆