Package flex.messaging.io.amf.client

Examples of flex.messaging.io.amf.client.AMFConnection


    // Not a test, just an example to show how to use AMFConnection.
    public static void main(String[] args2)
    {
        // Create the AMF connection.
        AMFConnection amfConnection = new AMFConnection();

        // Connect to the remote url.
        try
        {
            amfConnection.connect(DEFAULT_URL);
        }
        catch (ClientStatusException cse)
        {
            cse.printStackTrace();
        }

        // Make a remoting call and retrieve the result.
        try
        {
            Object result = amfConnection.call(getOperationCall("echo"), "Foo");
            System.out.println("Result: " + result);
        }
        catch (ClientStatusException cse)
        {
            cse.printStackTrace();
        }
        catch (ServerStatusException sse)
        {
            sse.printStackTrace();
        }
        finally
        {
            System.out.println("Done");
            amfConnection.close();
        }
    }
View Full Code Here


  /**
   * @param args
   */
  public static void main(String[] args) {
    AMFConnection amfConnection = new AMFConnection();
    amfConnection.setObjectEncoding(3);
    amfConnection.setInstantiateTypes(false);
    
    Object[] args1 = new Object[1];
    args1[0] = new String[]{"a","b"};
    try {
      amfConnection.connect("http://localhost/PHPArray-debug/gateway.php");
    } catch (ClientStatusException e1) {
      e1.printStackTrace();
    }
    
    RemotingMessage message = new RemotingMessage();
    message.setMessageId(flex.messaging.util.UUIDUtils.createUUID());
    message.setOperation("testarray");
    message.setBody(args1);
    message.setSource("PHPSvc");
    message.setDestination("PHPSvc");
   
        amfConnection.setObjectEncoding(3);
        amfConnection.setInstantiateTypes(false);
   
    Object returnValue = null;
   
    try {
      returnValue = amfConnection.call(null, message);
    } catch (ClientStatusException e) {

      e.printStackTrace();
    } catch (ServerStatusException e) {

View Full Code Here

    }

    public void _testConnectionCC() {
  try {
      AMFConnection amfConnection = new AMFConnection();

      String url = "http://ct-google.crimecitygame.com/ct-google/index.php/amf_gateway?f=104995124568475809013&r=43&t=none";
      String service = "BatchController.call";
      try {
    amfConnection.connect(url);
      } catch (ClientStatusException cse) {
    System.out.println(cse);
    return;
      }
      // Make a remoting call and retrieve the result.
      try {
    Object result = amfConnection.call(service);
    System.out.println("results: " + result.toString());
      } catch (ClientStatusException cse) {
    System.out.println(cse);
      } catch (ServerStatusException sse) {
    System.out.println(sse);
      }

      // Close the connection.
      amfConnection.close();

  } catch (Exception e) {
      e.printStackTrace();
      fail();
  }
View Full Code Here

TOP

Related Classes of flex.messaging.io.amf.client.AMFConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.