Welcome, Guest. Please login or register.
Did you miss your activation email?
05/21/12, 03:24
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  404 Error why? Use Service browser from Fl2004
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: 404 Error why? Use Service browser from Fl2004  (Read 7273 times)
Igor
Server what's that
*
Posts: 33



View Profile Email
« on: 03/07/05, 13:05 »

Hi!
All works fine on my machine: Apache+PHP. But when I put AMFPHP with HelloWOrld (for example) on the remote server I get Error 404, when use Sevice Browser. All CHMOD is 755.
May be there are some restrictions on the server site?
Is the reason in policy files?
Thank you! Wink
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 03/07/05, 15:38 »

Service Browser? You mean Webservice Browser?

Jorge
Logged

Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #2 on: 03/07/05, 16:19 »

Hi!
I mean Service Browser that is in Window>Other Panels>Service Browser (Flash 2004).
Now I tried to use Net Connection Debugger and get:
"...
Status (object #2)
.....code: "NetConnection.Call.BadVersion"
.....description: ""
.....details: ""
.....level: "error"
..."
Logged
Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #3 on: 03/07/05, 16:41 »

I am reading topic "General Errors with AMFPHP...
And call gateway.php in Browser
Here the answer:

Warning: main(../flashservices/app/Gateway.php): failed to open stream: No such file or directory in /home/nashastrelka/www/gateway.php on line 2

Warning: main(../flashservices/app/Gateway.php): failed to open stream: No such file or directory in /home/nashastrelka/www/gateway.php on line 2

Warning: main(): Failed opening '../flashservices/app/Gateway.php' for inclusion (include_path='.:/usr/local/php4/lib/php') in /home/nashastrelka/www/gateway.php on line 2

Fatal error: Cannot instantiate non-existent class: gateway in /home/nashastrelka/www/gateway.php on line 3
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #4 on: 03/07/05, 17:06 »

If it tells you, that the file does not exist, you either have mistyped the filename, or you dont have read access to this directory.

After most internet servers in the world are running UNIX or LINUX, be aware of capital letters. UNIX/LINUX makes a difference, so that Gateway is not the same as gateway.

Check your files and paths. In most cases this error is a mistype in either path or filename.
Logged

happy flashing
Cool
Ronald
Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #5 on: 03/07/05, 18:36 »

Thank you people Smiley. I now about capital letters. But now I have to check all again.
As I understand, I have to put AMFPHP into the  www folder? -For example:
home/nashstrelka/www/flashservices
and gateway.php I put in the same folder
When I type in browser http://www.strel-ka.ru/gateway.php I got the errors I told about.
But when I put flashservices folder a level up (hope you understand my pooore Eng) e.g. in the folder
home/strelka/  and when type in browser http://www.strel-ka.ru/gateway.php all was fine! (view sorce of empty HTML show "OK!")
But when I use from Fl2004 Net Connection Debugger I see:

Status (object #2)
.....code: 2
.....description: "unpack(): Type d: not enough input, need 8, have 0"
.....details: "/home/nashastrelka/flashservices/io/AMFInputStream.php"
.....level: "Warning"
.....line: 91

So now I will check all agian.
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #6 on: 03/08/05, 03:25 »

In the HelloWorld example there's a screenshot of the folder structure. It's a Windows scrennshot, but you can get the picture. gateway.php hosuld not be inside flashservices folder, and flashservices folder should be below the root directory.

Jorge
Logged

Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #7 on: 03/09/05, 16:55 »

Hi!
I am sorry I check all and now there is again about  ".....description: "unpack(): Type d: not enough input, need 8, have 0"  ".

I will be very glad to get any idea from one of the authors of AMFPHP and Gateway.php class inside it Smiley and other who have any ideas of course.
I am trying to start using AMFPHP. What for? I would like to get powerful engine of flash site - AdminPart. I can make news with Flash and php form,  but I want more  - to load/unload files etc.
All works fine on local machine Apache 1..+PHP 4...
But I can not even start with test service on remote server of my host company.
www.strel-ka.ru/helloWorld.html - that is the test movie.Input any text and push btn. Movie should get the  answer  from the server with the same text in the top text field.

CODE in movie   is:

import mx.remoting.Service;
import mx.remoting.NetServices;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
import mx.remoting.debug.NetDebug;

NetDebug.initialize();
//myResult = new Object();
var myService:Service=new Service("http://www.strel-ka.ru/gateway.php/",new Log(),"HelloWorld",null,new RelayResponder(this, "getInfo_Result", "getInfo_Fault"));

//var myService:Service=new Service("http://localhost/strelka/gateway.php",new Log(),"HelloWorld",null,new RelayResponder(this, "getInfo_Result", "getInfo_Fault"));

function getInfo_Result(re:ResultEvent): Void{
      answer.text=re.result
            };
function getInfo_Fault (e:ResultEvent):Void {
   answer.text = "Description: " + error.description;
}
btn.onRelease=function(){
   this.gotoAndStop(2)
   var test=txtInput.text
   var temp_pc:PendingCall =myService.makeEcho(test)
}
 

gateway.php (CHMOD 744) is in "www" folder on the server:
<?php
include("./flashservices/app/Gateway.php");
$gateway =new Gateway();
$gateway->setBaseClassPath(realpath("./flashservices/services/")."/");
$gateway->service();
print "OK";
?>

Flashservices folder is in "www" folder.
HelloWorld.php(CHMOD is 744) is in "www/flashservices" folder (and for testing purposes in "www" folder too). HelloWorld.php is:
<?php
class HelloWorld{
  function HelloWorld(){
   
    $this->methodTable = array(
            "makeEcho" => array(
                "description"     => "IGOR Echoes the passed argument back to Flash (no need to set the return type)",
                "access"         => "public",         // available values are private, public, remote
                "arguments"     => array ("arg1")
            )
    );

  }
  function makeEcho($messag){
       return $messag;
   
  }
}
?>

Additional info. When I use NetCOnnection Debugger in programm FMX 2004 I get:

DebugId: "0"
EventType: "Status"
MovieUrl: "file:///C|/DESIGNLERNINGbckup23.05.2004/DESIGNLERNING/StrelkaSite/BetaStrelkaFolders/ADMINpartSTRELKA/helloWorld.swf"
Protocol: "http"
Source: "Client"
Time: 1110398357186
Date (object #1)
....."Wed Mar 9 22:59:17 GMT+0300 2005"
Status (object #2)
.....code: 2
.....description: "unpack(): Type d: not enough input, need 8, have 0"  //this is to my mind the main reason, what does it mean?
.....details: "/home/nashastrelka/www/flashservices/io/AMFInputStream.php"
.....level: "Warning"
.....line: 91


When I use Service Browser in  FMX 2004 for getting the description of service "helloWorld" I get "ERROR 404" after trying to connect to remote server. On the other hand the result is positive on the local machine, and I get description.
And last important question for me. All tutorials use NetConnection class. But Macromedia recommends to use Service class as a most powerful. Is it ok for AMFPHP to use Service class? I use it and it works on local machine as you can see.
Thanx in advance. I spent  alot of time with this trouble.
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #8 on: 03/10/05, 03:16 »

The pack and unpack functions are part of the core serialization/deserialization proccess. Which server and PHP version are you running? Which amfphp version?

Jorge
Logged

Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #9 on: 03/10/05, 05:01 »

Hi!
Thak you for answer.
I see that php files in "www/flashservices/io/" folder

I use:
AMHPHP - 0.9.0
PHP Version 4.3.10
Apache/1.3.33 (Unix) mod_jk/1.2.5 FrontPage/5.0.2.2623 PHP/4.3.10

http://www.strel-ka.ru/phpInfo.php

Additionally I write small function to write a *.txt file to check the incoming of data in the HelloWorld.php:

 function makeEcho($message){
$v=fopen("amfphpTest.txt","w");
fwrite($v,$message,8000);
fclose( $v );
  return $message;
  }

 again on local OK-on the server- nothing!
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #10 on: 03/10/05, 05:47 »

Check this: http://www.strel-ka.ru/services/HelloWorld.php

Opening the class in browser is a basic debugging technique, check http://www.flash-db.com/Board/index.php?topic=5601.0

Jorge
Logged

Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #11 on: 03/10/05, 06:27 »

Jorge,
I am sorry, but I asked my host provider to help with this problem too. And right now they test.
AND I did test file Smiley)). Because I read this with this LETTERS  Smiley) on you nice board. "First check your php by call  it directly in browser! " - I read this of course.
Except all - the script works on local machine. If there was a problem I will get Error. But all worked.
I am a little bit confused? yess there is errors  Huh. I have to check.
Logged
Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #12 on: 03/10/05, 06:54 »

Hi!
as I told  Embarrassed, now there is no errors in http://www.strel-ka.ru/services/HelloWorld.php
but the result is still "Description: undefined" in answer text field.
I am in touch with my provider may they will find the reason.
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #13 on: 03/10/05, 13:20 »

Hi,

could you uplod file with just that script and post its location

<?
print "raw " . $GLOBALS['HTTP_RAW_POST_DATA'];
?>

Musicman
Logged
Igor
Server what's that
*
Posts: 33



View Profile Email
« Reply #14 on: 03/10/05, 16:36 »

Sure:
http://www.strel-ka.ru/AMFPHPtest.php
CHMOD IS 755
answer is "raw".

 
« Last Edit: 03/10/05, 16:42 by Igor » Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!