8 Replies Latest reply on Feb 15, 2011 10:02 PM by sethusubra1

    Java AMFConnection client - what is service url?

    HamletDRC

      I can't get the AMConnection object to connect to me BlazeDS service. How can I determine the URL and endpoint of my service?

       

      My BlazeDS service is a simple, no parameter hello world:

       

      package example.blaze;

      public class HelloWorldService {

          public String getHelloWorld() {
              return "Hello From BlazeDS";
          }
      }

       

      The destination in the remoting-config.xml is configured like this:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <service id="remoting-service" class="flex.messaging.services.RemotingService">

          <adapters>
              <adapter-definition id="java-object"
                                  class="flex.messaging.services.remoting.adapters.JavaAdapter"
                                  default="true"/>
          </adapters>

          <default-channels>
              <channel ref="my-amf"/>
          </default-channels>

          <destination id="helloworld">
              <properties>
                  <source>example.blaze.HelloWorldService</source>
              </properties>
              <adapter ref="java-object"/>
          </destination>

      </service>

       

      I would expect this Java client to work, but it doesn't:

       

              AMFConnection amfConnection = new AMFConnection()

              amfConnection.connect("http://localhost:8080/blazeds/")

              Object result = amfConnection.call("helloworld.getHelloWorld")

       

      The error is:

      ClientStatusException
          message: java.io.FileNotFoundException: http://localhost:8080/blazeds/
          code: AMFConnection.Call.Failed

       

      I've tried a lot of different variations on this endpoint and can't get anything to work.

       

      What is the correct parameter to AMFConnection#connect(String) and AMFConnection#call(String, Object...)?

       

      Thanks