public HelloWorldServiceClient(ConfigurationContext configCtx, String backendServerURL, String cookie) throws Exception{ String serviceURL = backendServerURL + "HelloWorldService"; stub = new HelloWorldServiceStub(configCtx, serviceURL); ServiceClient client = stub._getServiceClient(); Options options = client.getOptions(); options.setManageSession(true); options.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); }
public void SubscriberConstruct() { // Construct ServiceLookup information: The list of service to subscribe ArrayList<ServiceLookupMessage> lookupList = new ArrayList<ServiceLookupMessage>(); lookupList.add(new ServiceLookupMessage("USZip", "CityByZip", new Pair("Double", 85281), 1)); lookupList.add( new ServiceLookupMessage("Resort", "ResortByCity", new Pair("String", "tempe"), 1)); lookupList.add(new ServiceLookupMessage("VoiceComm", "qRate", new Pair("Hz", 220500), 60)); ServiceClient Subscriber1 = new ServiceClient("Subscriber1", lookupList, 0.1); Subscriber1.setBackgroundColor(Color.GREEN); // Construct the subscriber list SubscriberList.add(Subscriber1); }
static ApplyProductPartitionActionsResponse applyPartitionActions( ArrayOfAdGroupCriterionAction actions) throws RemoteException, Exception { ApplyProductPartitionActionsRequest request = new ApplyProductPartitionActionsRequest(); request.setCriterionActions(actions); return CampaignService.getService().applyProductPartitionActions(request); }
static void deleteCampaigns(long accountId, ArrayOflong campaignIds) throws RemoteException, Exception { DeleteCampaignsRequest request = new DeleteCampaignsRequest(); request.setAccountId(accountId); request.setCampaignIds(campaignIds); CampaignService.getService().deleteCampaigns(request); }
static ArrayOfAdGroupCriterion getAdGroupCriterionsByIds( long accountId, long adGroupId, ArrayOflong adGroupCriterionIds, CriterionType criterionType) throws RemoteException, Exception { GetAdGroupCriterionsByIdsRequest request = new GetAdGroupCriterionsByIdsRequest(); request.setAccountId(accountId); request.setAdGroupId(adGroupId); request.setAdGroupCriterionIds(adGroupCriterionIds); return CampaignService.getService().getAdGroupCriterionsByIds(request).getAdGroupCriterions(); }
static AddAdsResponse addAds(long adGroupId, ArrayOfAd ads) throws RemoteException, Exception { AddAdsRequest request = new AddAdsRequest(); // Set the request information. request.setAdGroupId(adGroupId); request.setAds(ads); return CampaignService.getService().addAds(request); }
static AddCampaignsResponse addCampaigns(long accountId, ArrayOfCampaign campaigns) throws RemoteException, Exception { AddCampaignsRequest request = new AddCampaignsRequest(); // Set the request information. request.setAccountId(accountId); request.setCampaigns(campaigns); return CampaignService.getService().addCampaigns(request); }
private String findRoute(String api) { String urlroute = null; for (String key : routeMap.keySet()) { Pattern p = Pattern.compile(key); Matcher m = p.matcher(api); if (m.find()) { String service = routeMap.get(key); urlroute = serviceClient.discoverAddress(service) + api; } } return urlroute; }
public static AdGroupEstimatedBid getAdGroupEstimatedBidByKeywords(Currency currency, ArrayOfKeywordAndMatchType keywordAndMatchTypes, java.lang.String language, ArrayOfstring publisherCountries, TargetAdPosition targetPositionForAds) throws RemoteException, Exception { GetEstimatedBidByKeywordsRequest request = new GetEstimatedBidByKeywordsRequest(); // Set the Currency, Keywords, Language, PublisherCountries, and TargetPositionForAds // for the estimated bid by keywords request. request.setCurrency(currency); request.setGetBidsAtLevel(2); // Set GetBidsAtLevel to 2 to get one AdGroupEstimatedBid. request.setKeywords(keywordAndMatchTypes); request.setLanguage(language); request.setPublisherCountries(publisherCountries); request.setTargetPositionForAds(targetPositionForAds); return AdIntelligenceService.getService().getEstimatedBidByKeywords(request).getAdGroupEstimatedBid(); }
@Test public void testInstanceInjection() { DSInjector injector = DependencyShot.getInjector(new EasyInstanceBinder()); ServiceClient client = injector.getInstance(ServiceClient.class); assertTrue(client.getService().getValue().equals(EasyInstanceBinder.MY_MODULE)); }
static AddCampaignCriterionsResponse addCampaignCriterion(final long CAMPAIGN_ID) throws RemoteException, Exception { AddCampaignCriterionsRequest request = new AddCampaignCriterionsRequest() { { criterionType = new ArrayList<CampaignCriterionType>() { { add(CampaignCriterionType.PRODUCT_SCOPE); } }; campaignCriterions = new ArrayOfCampaignCriterion() { { campaignCriterions = new ArrayList<CampaignCriterion>() { { add( new CampaignCriterion() { { campaignId = CAMPAIGN_ID; bidAdjustment = null; // Reserved for future use criterion = new ProductScope() { { conditions = new ArrayOfProductCondition() { { productConditions = new ArrayList<ProductCondition>() { { add( new ProductCondition() { { operand = "Condition"; attribute = "New"; } }); add( new ProductCondition() { { operand = "Brand"; attribute = "Contoso"; } }); } }; } }; } }; } }); } }; } }; } }; return CampaignService.getService().addCampaignCriterions(request); }
static ArrayOfBMCStore getBMCStoresByCustomerId() throws RemoteException, Exception { GetBMCStoresByCustomerIdRequest request = new GetBMCStoresByCustomerIdRequest(); return CampaignService.getService().getBMCStoresByCustomerId(request).getBMCStores(); }