RE: [flexcoders] Re: More questions on weborb, creating my own services
apologies, now I read valdhors example code I see the endpoint is set in the code, here : > channelSet = new ChannelSet(); > amfChannel = new AMFChannel("my-amf", > "http://myserver/WebORB/weborb.php";); > channelSet.addChannel(amfChannel); so it's there you need to change localhost to 127.0.0.1 (or vice versa), not in the services config xml. -Original Message- From: flexcoders@yahoogroups.com on behalf of Jim Hayes Sent: Thu 02/10/2008 13:05 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: More questions on weborb, creating my own services that one has irritated me before! it sees 127.0.0.1 and localhost as being different domains (correctly I believe). if you change either the endpoint in the services xml file or the debugging url in project properties such that they match then you should find it all works (apologies for not being more precise in terms of the changes, I'm away from flexbuilder at the moment and my memory is ropey) __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __<>
RE: [flexcoders] Re: More questions on weborb, creating my own services
that one has irritated me before! it sees 127.0.0.1 and localhost as being different domains (correctly I believe). if you change either the endpoint in the services xml file or the debugging url in project properties such that they match then you should find it all works (apologies for not being more precise in terms of the changes, I'm away from flexbuilder at the moment and my memory is ropey) -Original Message- From: flexcoders@yahoogroups.com on behalf of timgerr Sent: Thu 02/10/2008 05:01 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: More questions on weborb, creating my own services OK, I did everything that was given and when I run the app I get this error: warning: Failed to load policy file from http://127.0.0.1/crossdomain.xml *** Security Sandbox Violation *** Connection to http://127.0.0.1/weborb/weborb.php halted - not permitted from http://localhost/weborb/WebORBExample-debug/WebORBExample.swf Error: Request for resource at http://127.0.0.1/weborb/weborb.php by requestor from http://localhost/weborb/WebORBExample-debug/WebORBExample.swf is denied due to lack of policy file permissions. Not sure what to do here. Thanks for the help, timgerr --- In flexcoders@yahoogroups.com, "valdhor" <[EMAIL PROTECTED]> wrote: > > This seems to be a convoluted way to do this. > > I have created a simple example to show you how I use WebOrb. > > On my server I have the WebORB directory at the root level. In the > Services directory I have a MyServices directory and in this directory I > have a ValueObjects directory. For this example I have two files: > > = > TestNamesInVO.php: > class TestNamesInVO > { > public $FirstName; > public $LastName; > > public function __construct($FirstName, $LastName) > { > $this->FirstName = $FirstName; > $this->LastName = $LastName; > } > } > ?> > = > TestNamesOutVO.php: > class TestNamesOutVO > { > public $FullName; > > public function __construct($FullName) > { > $this->FullName = $FullName; > } > } > ?> > = > > The constructors are there just to make it easier to create a new > object. They are optional. > > In the MyServices directory I have a TestService.php file. This contains > all the functions available with this service. > > = > TestService.php: > class TestService > { > function ShowMe() > { > return "Tom Jones"; > } > > function ShowName($name) > { > return 'Hello ' . $name; > } > > function ShowNames(TestNamesInVO $namesIn) > { > require_once("ValueObjects/TestNamesInVO.php"); > require_once("ValueObjects/TestNamesOutVO.php"); > > $fullName = new TestNamesOutVO($namesIn->FirstName . " " . > $namesIn->LastName); > > return $fullName; > } > } > ?> > = > > In flex I also have a ValueObjects folder underneath my src folder. This > folder contains the corresponding ActionScript files for the value > objects on the server: > > = > TestNamesInVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesInVO")] > [Bindable] > public class TestNamesInVO > { > //instance variables > private var _FirstName:String; > private var _LastName:String; > > //accessor methods > public function get FirstName():String {return _FirstName;} > public function get LastName():String {return _LastName;} > > //mutator methods > public function set FirstName(FirstName:String):void {_FirstName > = FirstName;} > public function set LastName(LastName:String):void {_LastName = > LastName;} > } // end class > }//end package > = > TestNamesOutVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesOutVO")] > [Bindable] > public class TestNamesOutVO > { > //instance variables > private var _FullName:String; > > //accessor methods > public function get FullName():String {return _FullName;} > > //mutator methods > public function set FullName(FullName:String):void {_FullName = > FullName;} > } // end class > }//end package > = > > Note the RemoteClass metadata. This tells flex the location of the class > on the server that matches this class (In relation to the Services > directory). > > Finally we have