我有一個flex 4.5 php應用程序,可以在localhost上完美運行。當我把它上傳到我的遠程主機,我遇到一個奇怪的問題,當我嘗試訪問產能釋放:搬到生產服務器
1. If I am the computer running my localhost, then the production site works.
2. If I am on any other computer then the production site returns the error: "Send failed Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://localhost/public/gateway.php'"
總之,發佈版本正在尋找我的本地機器上的文件。我究竟做錯了什麼?如果你嘗試在Flash Builder 4中使用這個例子,那麼它就會工作。當你嘗試在遠程服務器上運行發佈版本時,問題只出現在Flash Builder 4.5中(你也必須訪問遠程網站,本地主機關閉,作爲瑞士法郎抓住從本地主機文件)
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:testclass="services.testclass.*"
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function getService(event:FlexEvent):void
{
label2.text='this function did NOT work';
testFunctionResult.token = testClass.testFunction();
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="testFunctionResult"/>
<testclass:TestClass id="testClass"
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
showBusyCursor="true"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:VGroup width="100%" height="100%" x="75">
<s:Spacer height="25"/>
<s:Label fontSize="18" color="Black" text="did this work?"/>
<s:Label id="label2" color="Blue"
creationComplete="getService(event)" text="{testFunctionResult.lastResult}"/>
</s:VGroup>
</s:Application>
<?php
class TestClass{
public function testFunction(){
return "this function worked";
}
}
?>
thx。這隻在我升級到4.5時才發生在Flex 4中。我找不到本地硬編碼的任何地方。 –
您使用的是AMF/RemoteObject嗎?還是HTTPService?還是WebService? – JeffryHouser
php w/ZendFramework –