Skip to main content
Inspiring
October 8, 2017
Question

Deploy RemoteObject Service Remotely

  • October 8, 2017
  • 1 reply
  • 367 views

OK, I finally got my webservices converted from XML webservices to

RemoteObject AMF services on my local machine and it is working like a

charm, fast as lightning.  But this is a mobile app and the database and

services need to be moved to a server, and I am struggling to get everything

set up properly to communicate remotely.  Here is what I have done:

1) I moved the folder containing my services to my webserver, it is called

mytestservice2. It contains four php files - index.php, HalfService.php,

VOService.php, VOCompsService.php.  Index.php is the important one as it

exposes the Zend AMF endpoint.  When I use my browser to browse to

http://www.billspencere.com/mytestservice2/index.php, it displays "Zend AMF

Endpoint".  So I know that PHP and Zend include_paths are all set properly

to locate Zend AMF.

2) I altered my services-config.xml file to point to the new endpoint in the

URI at the bottom of the file.  Here is the code:

<?xml version="1.0" encoding="UTF-8"?>

<services-config>

    <services>

        <service id="amfphp-flashremoting-service"

class="flex.messaging.services.RemotingService"

messageTypes="flex.messaging.messages.RemotingMessage">

            <destination id="zend">

                <channels>

                    <channel ref="my-zend"/>

                </channels>

                <properties>

                    <source>*</source>

                </properties>

            </destination>

        </service>

    </services>

    <channels>

        <channel-definition id="my-zend"

class="mx.messaging.channels.AMFChannel">

            <endpoint uri="http://www.billspencere.com/mytestservice2"

class="flex.messaging.endpoints.AMFEndpoint"/>

        </channel-definition>

    </channels>

</services-config>

3) I make sure that the compiler knows to include the services-config.xml

file when it compiles by adding this statement to my additional compiler

arguements dialogue:

-services "C:\Users\waspe\Adobe Flash Builder

4.7\RemoteObjectTest5\services-config.xml"

Unfortuanately, it is not making all of the appropriate connections because

I keep getting this error when I run the program:

[RPC Fault faultString="Channel disconnected"

faultCode="Client.Error.DeliveryInDoubt" faultDetail="Channel disconnected

before an acknowledgement was received"]

This is the most important and final step in my development cycle.  I have

to be able to get this deployed to a server and connect remotely.  Please

give me any thoughts that you may have AT ALL!!!

Thanks,

Bill

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
October 9, 2017

You don't mention if this is iOS or Android. 'http' isn't allowed under iOS anymore, you will need to get your server to be https. Not sure whether the same applies to Android.

Inspiring
October 9, 2017

You may be right, and if you are, that kind of scares me because I would have a lot of code to replace.  But in my case, that doesn't appear to be what the problem was.  Apparently, when I would make changes to my services-config.xml file, it was not updating the file before it compiled.  So I would make changes to the endpoint address, but when I looked at the errors, it was still displaying the old address.  So each time a I made a change to this xml file, I had to do a Clean of the project before I could compile it and inclde those new changes.  Very Strange, and outrgeously frustrating. But I eventually found the right combination, and it is working even though the address is http: and not https:  Although, I have not had an opportunity to try and upload this to my iPad yet, so we will see.

Colin Holgate
Inspiring
October 9, 2017

Servers will cache XML. You could change the name of the file for a fresh start, or talk to the server people to ask how you can clear the cache. I'm not talking about local cache, it's the server's cache that needs to be cleared.