Example: amf_call

This example shows calls to the AMF messsage broker.

web_add_auto_header("x-flash-version", "9,0,47,0");
amf_call("null", 
    "Gateway=http://localhost:8700/flex/messagebroker/amf", 
    "Snapshot=t5.inf", 
    MESSAGE, 
    "Method=null", 
    "TargetObjectId=/1", 
    BEGIN_ARGUMENTS, 
    "<AMF3><object><object-class className=\""
    "flex.messaging.messages.CommandMessage\"><object-class-member "
    "memberName=\"operation\"/><object-class-member memberName=\""
    "correlationId\"/><object-class-member memberName=\"body\"/>"
    "<object-class-member memberName=\"destination\"/><object-class-member "
    "memberName=\"clientId\"/><object-class-member memberName=\"timeToLive"
    "\"/><object-class-member memberName=\"messageId\"/>"
    "<object-class-member memberName=\"headers\"/><object-class-member "
    "memberName=\"timestamp\"/></object-class><object-content>"
    "<object-member memberName=\"operation\"><integer>5</integer></"
    "object-member><object-member memberName=\"correlationId\"><string></"
    "string></object-member><object-member memberName=\"body\"><object>"
    "<object-class className=\"\"/><object-content/></object></"
    "object-member><object-member memberName=\"destination\"><string></"
    "string></object-member><object-member memberName=\"clientId\"><null/><"
    "/object-member><object-member memberName=\"timeToLive\"><integer>0</"
    "integer></object-member><object-member memberName=\"messageId\">"
    "<string>7247D4DA-CBD7-188D-BBB5-9EB66AB02B6E</string></object-member>"
    "<object-member memberName=\"headers\"><object><object-class className="
    "\"\"/><object-content/><object-dynamic-content><object-dynamic-member "
    "dynamicMemberName=\"DSId\"><string>nil</string></object-dynamic-member"
    "></object-dynamic-content></object></object-member><object-member "
    "memberName=\"timestamp\"><integer>0</integer></object-member></"
    "object-content></object></AMF3>", 
    END_ARGUMENTS, 
    LAST );
amf_call("EchoService::echostring", 
    "Gateway=http://localhost:8700/flex/messagebroker/amf", 
    "Snapshot=t6.inf", 
    MESSAGE, 
    "Method=null", 
    "TargetObjectId=/2", 
    BEGIN_ARGUMENTS, 
    "<AMF3><object><object-class className=\""
    "flex.messaging.messages.RemotingMessage\"><object-class-member "
    "memberName=\"operation\"/><object-class-member memberName=\"source\"/>"
    "<object-class-member memberName=\"body\"/><object-class-member "
    "memberName=\"destination\"/><object-class-member memberName=\""
    "clientId\"/><object-class-member memberName=\"timeToLive\"/>"
    "<object-class-member memberName=\"messageId\"/><object-class-member "
    "memberName=\"headers\"/><object-class-member memberName=\"timestamp\"/"
    "></object-class><object-content><object-member memberName=\"operation"
    "\"><string>echostring</string></object-member><object-member "
    "memberName=\"source\"><null/></object-member><object-member memberName"
    "=\"body\"><array arrayLength=\"1\"><array-members-part><array-member>"
    "<string>qwe</string></array-member></array-members-part></array></"
    "object-member><object-member memberName=\"destination\"><string"
    ">EchoService</string></object-member><object-member memberName=\""
    "clientId\"><null/></object-member><object-member memberName=\""
    "timeToLive\"><integer>0</integer></object-member><object-member "
    "memberName=\"messageId\"><string>9CA78BE1-7A11-A25C-69CB-9EB66A6293FE<"
    "/string></object-member><object-member memberName=\"headers\"><object>"
    "<object-class className=\"\"/><object-content/><object-dynamic-content"
    "><object-dynamic-member dynamicMemberName=\"DSEndpoint\"><string"
    ">my-amf</string></object-dynamic-member><object-dynamic-member "
    "dynamicMemberName=\"DSId\"><string"
    ">C87B6498-761A-44E9-80E8-EB9252C79CD6</string></object-dynamic-member>"
    "</object-dynamic-content></object></object-member><object-member "
    "memberName=\"timestamp\"><integer>0</integer></object-member></"
    "object-content></object></AMF3>", 
    END_ARGUMENTS, 
    LAST );
amf_call("EchoService::echostring_1", 
    "Gateway=http://localhost:8700/flex/messagebroker/amf", 
    "Snapshot=t7.inf", 
    MESSAGE, 
    "Method=null", 
    "TargetObjectId=/3", 
    BEGIN_ARGUMENTS, 
    "<AMF3><object><object-class className=\""
    "flex.messaging.messages.RemotingMessage\"><object-class-member "
    "memberName=\"operation\"/><object-class-member memberName=\"source\"/>"
    "<object-class-member memberName=\"body\"/><object-class-member "
    "memberName=\"destination\"/><object-class-member memberName=\""
    "clientId\"/><object-class-member memberName=\"timeToLive\"/>"
    "<object-class-member memberName=\"messageId\"/><object-class-member "
    "memberName=\"headers\"/><object-class-member memberName=\"timestamp\"/"
    "></object-class><object-content><object-member memberName=\"operation"
    "\"><string>echostring</string></object-member><object-member "
    "memberName=\"source\"><null/></object-member><object-member memberName"
    "=\"body\"><array arrayLength=\"1\"><array-members-part><array-member>"
    "<string>qwe</string></array-member></array-members-part></array></"
    "object-member><object-member memberName=\"destination\"><string"
    ">EchoService</string></object-member><object-member memberName=\""
    "clientId\"><string>C87B6F07-5C0B-C917-1EC3-1633788A2637</string></"
    "object-member><object-member memberName=\"timeToLive\"><integer>0</"
    "integer></object-member><object-member memberName=\"messageId\">"
    "<string>9EA05B82-0126-147D-1EF2-9EB66A914248</string></object-member>"
    "<object-member memberName=\"headers\"><object><object-class className="
    "\"\"/><object-content/><object-dynamic-content><object-dynamic-member "
    "dynamicMemberName=\"DSEndpoint\"><string>my-amf</string></"
    "object-dynamic-member><object-dynamic-member dynamicMemberName=\"DSId"
    "\"><string>C87B6498-761A-44E9-80E8-EB9252C79CD6</string></"
    "object-dynamic-member></object-dynamic-content></object></"
    "object-member><object-member memberName=\"timestamp\"><integer>0</"
    "integer></object-member></object-content></object></AMF3>", 
    END_ARGUMENTS, 
    MESSAGE, 
    "Method=null", 
    "TargetObjectId=/4", 
    BEGIN_ARGUMENTS, 
    "<AMF3><object><object-class className=\""
    "flex.messaging.messages.RemotingMessage\"><object-class-member "
    "memberName=\"operation\"/><object-class-member memberName=\"source\"/>"
    "<object-class-member memberName=\"body\"/><object-class-member "
    "memberName=\"destination\"/><object-class-member memberName=\""
    "clientId\"/><object-class-member memberName=\"timeToLive\"/>"
    "<object-class-member memberName=\"messageId\"/><object-class-member "
    "memberName=\"headers\"/><object-class-member memberName=\"timestamp\"/"
    "></object-class><object-content><object-member memberName=\"operation"
    "\"><string>echostring</string></object-member><object-member "
    "memberName=\"source\"><null/></object-member><object-member memberName"
    "=\"body\"><array arrayLength=\"1\"><array-members-part><array-member>"
    "<string>qwe</string></array-member></array-members-part></array></"
    "object-member><object-member memberName=\"destination\"><string"
    ">EchoService</string></object-member><object-member memberName=\""
    "clientId\"><string>C87B6F07-5C0B-C917-1EC3-1633788A2637</string></"
    "object-member><object-member memberName=\"timeToLive\"><integer>0</"
    "integer></object-member><object-member memberName=\"messageId\">"
    "<string>4566C3AF-DD5B-E767-4B95-9EB66A9192BC</string></object-member>"
    "<object-member memberName=\"headers\"><object><object-class className="
    "\"\"/><object-content/><object-dynamic-content><object-dynamic-member "
    "dynamicMemberName=\"DSEndpoint\"><string>my-amf</string></"
    "object-dynamic-member><object-dynamic-member dynamicMemberName=\"DSId"
    "\"><string>C87B6498-761A-44E9-80E8-EB9252C79CD6</string></"
    "object-dynamic-member></object-dynamic-content></object></"
    "object-member><object-member memberName=\"timestamp\"><integer>0</"
    "integer></object-member></object-content></object></AMF3>", 
    END_ARGUMENTS, 
    LAST );