"emptyMethodAction", "emptyMethodActionResponse" => "emptyMethodActionResponse", "login" => "login", "loginResponse" => "loginResponse", "AccountDataBean" => "AccountDataBean", "getOrders" => "getOrders", "getOrdersResponse" => "getOrdersResponse", "ArrayOfOrderDataBean" => "ArrayOfOrderDataBean", "OrderDataBean" => "OrderDataBean", "getAccountData" => "getAccountData", "getAccountDataResponse" => "getAccountDataResponse", "getAccountProfileData" => "getAccountProfileData", "getAccountProfileDataResponse" => "getAccountProfileDataResponse", "AccountProfileDataBean" => "AccountProfileDataBean", "updateAccountProfile" => "updateAccountProfile", "updateAccountProfileResponse" => "updateAccountProfileResponse", "logout" => "logout", "logoutResponse" => "logoutResponse", "buy" => "buy", "buyResponse" => "buyResponse", "sell" => "sell", "sellResponse" => "sellResponse", "getHoldings" => "getHoldings", "getHoldingsResponse" => "getHoldingsResponse", "ArrayOfHoldingDataBean" => "ArrayOfHoldingDataBean", "HoldingDataBean" => "HoldingDataBean", "register" => "register", "registerResponse" => "registerResponse", "getClosedOrders" => "getClosedOrders", "getClosedOrdersResponse" => "getClosedOrdersResponse", "getMarketSummary" => "getMarketSummary", "getMarketSummaryResponse" => "getMarketSummaryResponse", "MarketSummaryDataBeanWS" => "MarketSummaryDataBeanWS", "ArrayOfQuoteDataBean" => "ArrayOfQuoteDataBean", "QuoteDataBean" => "QuoteDataBean", "getQuote" => "getQuote", "getQuoteResponse" => "getQuoteResponse", "getHolding" => "getHolding", "getHoldingResponse" => "getHoldingResponse", "getTopOrders" => "getTopOrders", "getTopOrdersResponse" => "getTopOrdersResponse", "sellEnhanced" => "sellEnhanced", "sellEnhancedResponse" => "sellEnhancedResponse", "isOnline" => "isOnline", "isOnlineResponse" => "isOnlineResponse"); // define PHP functions that maps to WSDL operations function emptyMethodAction($input) { return; } /** * Used by the service to provide login functionality. * @param input login input object * @return an AccountDataBean object on success * and null on failure. */ function login($input) { $response = null; if($input) { $response = processLogin($input->userID, $input->password); } else { } return $response; } /** * To get the Top five order information. * @param input contains the userID * @return an array of OrderDataBean objects */ function getOrders($input) { $response = null; if($input) { //This method only get the top five order information. $response = processGetTopOrders($input->userID); } else { } return $response; } /** * This method obtains information about a particular * user's Account * @param input contains the userID * @return an AccountDataBean object */ function getAccountData($input) { $response = null; if($input) { $response = processGetAccountData($input->userID); } else { } return $response; } /** * This method obtains profile information about a particular * user. * @param input contains userID * @return an AccountProfileDataBean object. */ function getAccountProfileData($input) { $response = null; if($input) { $response = processGetAccountProfileData($input->userID); } else { } return $response; } /** * This method gets the order information with status "closed" * @param input contains the userID * @return an ArrayOfOrderDataBean object. */ function getClosedOrders($input) { $response = null; if($input) { $response = processGetClosedOrders($input->userID); } else { } return $response; } /** * This method updates user profile information. * @param input contains an AccountProfileDataBean object. * @return an AccountProfileDataBean object. */ function updateAccountProfile($input) { $response = null; if($input) { $response = processUpdateAccountProfile( $input->profileData); } else { } return $response; } /** * This method is used to logout a particular user. * @param input contains the userID * @return a logoutResponse object. */ function logout($input) { $response = null; if($input) { $response = processLogout($input->userID); } else { } return $response; } /** * This method is used to do a buy operation. * @param input contains an order object. * @return an OrderDataBean object on success. */ function buy($input) { $response = null; if($input) { $response = processBuy($input); } else { } return $response; } /** * This method is used to do a sell operation. * @param input contains an order object. * @return an OrderDataBean object on success. */ function sell($input) { $response = null; if($input) { $response = processSell($input); } else { } return $response; } /** * This method is used to get Holding information of a particular user. * @param input contains a userID. * @return an ArrayOfHoldingDataBean object. */ function getHoldings($input) { $response = null; if($input) { $response = processGetHoldings($input->userID); } else { } return $response; } /** * This method is used to register a new user. * @param input contains a user information. * @return an AccountDataBean object. */ function register($input) { $response = null; if($input) { $response = processRegister($input); } else { } return $response; } /** * This method is used to get Market Summary information. * @param input getMarketSummaryObject. * @return a MarketSummaryDataBeanWS object. */ function getMarketSummary($input) { $response = null; if($input) { $response = processGetMarketSummary(); } else { } return $response; } /** * This method is used to get quote information of a symbol. * @param input contains the symbol. * @return a QuoteDataBean object. */ function getQuote($input) { $response = null; if($input) { $response = processGetQuote($input->symbol); } else { } return $response; } /** * This method is used to get holding information. * @param input contains userID and the holdingID. * @return a HoldingDataBean object. */ function getHolding($input) { $response = null; if($input) { $response = processGetHolding($input); } else { } return $response; } /** * This method is used to get the top order information of a user. * @param input contains userID. * @return an ArrayOfOrderDataBean object. */ function getTopOrders($input) { $response = null; if($input) { $response = processGetTopOrders($input->userID); } else { } return $response; } /** * This method is used to do a sell operation (with some quantity). * @param input contains userID, holdingID and the quantity. * @return an OrderDataBean object. */ function sellEnhanced($input) { $response = null; if($input) { $response = processSellEnhanced($input); } else { } return $response; } /** * This method is used to check whether the service is online or not. * @param input an isOnline object. * @return an isOnline object. */ function isOnline($input) { return new isOnline(); } // define the operations map $operations = array( "emptyMethodAction" => "emptyMethodAction", "login" => "login", "getOrders" => "getOrders", "getAccountData" => "getAccountData", "getAccountProfileData" => "getAccountProfileData", "updateAccountProfile" => "updateAccountProfile", "logout" => "logout", "buy" => "buy", "sell" => "sell", "getHoldings" => "getHoldings", "register" => "register", "getClosedOrders" => "getClosedOrders", "getMarketSummary" => "getMarketSummary", "getQuote" => "getQuote", "getHolding" => "getHolding", "getTopOrders" => "getTopOrders", "sellEnhanced" => "sellEnhanced", "isOnline" => "isOnline"); // define the actions => operations map $actions = array( "http://trade.samples.websphere.ibm.com/ITradeServices/login" => "login", "getOrders" => "getOrders", "getAccountData" => "getAccountData", "getAccountProfileData" => "getAccountProfileData", "updateAccountProfile" => "updateAccountProfile", "logout" => "logout", "buy" => "buy", "sell" => "sell", "getHoldings" => "getHoldings", "register" => "register", "getClosedOrders" => "getClosedOrders", "getMarketSummary" => "getMarketSummary", "http://trade.samples.websphere.ibm.com/ITradeServices/getQuote" => "getQuote", "getHolding" => "getHolding", "getTopOrders" => "getTopOrders", "sellEnhanced" => "sellEnhanced", "isOnline" => "isOnline"); // create service in WSDL mode $service = new WSService(array ("wsdl" =>"wsdl/TradeServiceWcf.svc.wsdl", "actions" => $actions, "classmap" => $class_map, "operations" => $operations)); // process client requests and reply $service->reply(); ?>