/** * List Marketplace Participations Action Sample * This operation can be used to list all Marketplaces that a seller can sell in. * The operation returns a List of Participation elements and a List of Marketplace * elements. The SellerId is the only parameter required by this operation. * * @param MarketplaceWebServiceSellers_Interface $service instance of MarketplaceWebServiceSellers_Interface * @param mixed $request MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations or array of parameters */ function invokeListMarketplaceParticipations(MarketplaceWebServiceSellers_Interface $service, $request) { try { $response = $service->listMarketplaceParticipations($request); echo "Service Response\n"; echo "=============================================================================\n"; echo " ListMarketplaceParticipationsResponse\n"; if ($response->isSetListMarketplaceParticipationsResult()) { echo " ListMarketplaceParticipationsResult\n"; $listMarketplaceParticipationsResult = $response->getListMarketplaceParticipationsResult(); if ($listMarketplaceParticipationsResult->isSetNextToken()) { echo " NextToken\n"; echo " " . $listMarketplaceParticipationsResult->getNextToken() . "\n"; } if ($listMarketplaceParticipationsResult->isSetListParticipations()) { echo " ListParticipations\n"; $listParticipations = $listMarketplaceParticipationsResult->getListParticipations(); $participationList = $listParticipations->getParticipation(); foreach ($participationList as $participation) { echo " Participation\n"; if ($participation->isSetMarketplaceId()) { echo " MarketplaceId\n"; echo " " . $participation->getMarketplaceId() . "\n"; } if ($participation->isSetSellerId()) { echo " SellerId\n"; echo " " . $participation->getSellerId() . "\n"; } if ($participation->isSetHasSellerSuspendedListings()) { echo " HasSellerSuspendedListings\n"; echo " " . $participation->getHasSellerSuspendedListings() . "\n"; } } } if ($listMarketplaceParticipationsResult->isSetListMarketplaces()) { echo " ListMarketplaces\n"; $listMarketplaces = $listMarketplaceParticipationsResult->getListMarketplaces(); $marketplaceList = $listMarketplaces->getMarketplace(); foreach ($marketplaceList as $marketplace) { echo " Marketplace\n"; if ($marketplace->isSetMarketplaceId()) { echo " MarketplaceId\n"; echo " " . $marketplace->getMarketplaceId() . "\n"; } if ($marketplace->isSetName()) { echo " Name\n"; echo " " . $marketplace->getName() . "\n"; } if ($marketplace->isSetDefaultLanguageCode()) { echo " DefaultLanguageCode\n"; echo " " . $marketplace->getDefaultLanguageCode() . "\n"; } if ($marketplace->isSetDefaultCountryCode()) { echo " DefaultCountryCode\n"; echo " " . $marketplace->getDefaultCountryCode() . "\n"; } if ($marketplace->isSetDefaultCurrencyCode()) { echo " DefaultCurrencyCode\n"; echo " " . $marketplace->getDefaultCurrencyCode() . "\n"; } if ($marketplace->isSetDomainName()) { echo " DomainName\n"; echo " " . $marketplace->getDomainName() . "\n"; } } } } if ($response->isSetResponseMetadata()) { echo " ResponseMetadata\n"; $responseMetadata = $response->getResponseMetadata(); if ($responseMetadata->isSetRequestId()) { echo " RequestId\n"; echo " " . $responseMetadata->getRequestId() . "\n"; } } echo " ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n"; } catch (MarketplaceWebServiceSellers_Exception $ex) { echo "Caught Exception: " . $ex->getMessage() . "\n"; echo "Response Status Code: " . $ex->getStatusCode() . "\n"; echo "Error Code: " . $ex->getErrorCode() . "\n"; echo "Error Type: " . $ex->getErrorType() . "\n"; echo "Request ID: " . $ex->getRequestId() . "\n"; echo "XML: " . $ex->getXML() . "\n"; echo "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n"; } }