"anyType", "OrderDataBean" => "OrderDataBean", "SubmitOrder" => "SubmitOrder", "isOnline" => "isOnline"); class isOnline { } /** * This method corresponds to the primary operation of the service.It processes * an incomming order object. * @param input, the order object, filled with data correspond to an order * @return accept upon success. */ function SubmitOrder($input) { SendAcceptNotification(); if ($input->order != NULL) { if(($input->order->orderType == ORDER_TYPE_BUY) || ($input->order->orderType == ORDER_TYPE_SELL)) { ProcessOrder($input->order); } else { error_log ("Incoming order type is incorrect.\n"); } } else { error_log ("Incoming order request is NULL.\n"); } } /** * This method obtains some additional time and let the business service * to store information regarding an order. Then the OrderProcessor can * continue processing the order request that was just stored in the * database. */ function SendAcceptNotification() { header('HTTP/1.1 202 Accepted'); header('Content-Length: 0'); flush(); sleep(1); } /** * This function corresponds to the isOnline operation. This is used by the * Configuration service to make sure that the OrderProcessor service is * online. * @return just a return is expected to make sure the service is online. */ function isOnline($input) { return; } // define the operations map $operations = array("SubmitOrder" => "SubmitOrder", "isOnline" => "isOnline"); // define the actions => operations map $actions = array("SubmitOrderOnePhase" => "SubmitOrder", "isOnline" => "isOnline"); //This is the security information $pvt_key = ws_get_key_from_file("./keys/bob_key.pem"); $policy_xml = file_get_contents("policy.xml"); $policy = new WSPolicy($policy_xml); $sec_token = new WSSecurityToken(array("privateKey" => $pvt_key)); // create service in WSDL mode $service = new WSService(array ("wsdl" =>"TradeOrders.wsdl", "operations" => $operations, "actions" => $actions, "policy" => $policy, "securityToken" => $sec_token, "classmap" => $class_map,)); // process client requests and reply $service->reply(); ?>