Java SDk返回的时区数据在任何地方都没有定义? [英] Timezone data returned by Java SDk is not defined anywhere?

查看:76
本文介绍了Java SDk返回的时区数据在任何地方都没有定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

旧的Java WSDL类返回了此处定义的时区值:


https://msdn.microsoft.com/en-US/library/bing-ads- time-zones.aspx



但是,新的Java SDK会返回不同的值。例如,它返回:


GREENWICH_MEAN_TIME_DUBLIN_EDINBURGH_LISBON_LONDON


而不是


GreenwichMeanTimeDublinEdinburghLisbonLondon



这是否全面改变?



解决方案

我们使用'wsimport'为Bing Ads Java SDK生成代理,你可以查找详细信息
此处GitHub 。您看到的UPPER_CASE_UNDERSCORE模式默认由wsimport为所有值集生成,例如客户管理服务中的TimeZoneType和Campaign Management服务中的BudgetLimitType
。使用Eclipse之类的IDE,可以通过intellisense获取可能的值。 


当预期字符串(不是值设置)时,服务会接受您看到的值。例如,在添加广告系列时,您可以使用您看到的CamelCase值之一设置时区
在MSDN上。 

广告系列广告系列=新广告系列(); 
campaign.setName(" Winter Clothing" + System.currentTimeMillis());
campaign.setDescription(" Winter clothing line。);
campaign.setBudgetType(BudgetLimitType。 MONTHLY_BUDGET_SPEND_UNTIL_DEPLETED );
campaign.setMonthlyBudget(1000.00);
campaign.setTimeZone(" PacificTimeUSCanadaTijuana ");
campaign.setDaylightSaving(true);




我希望这有帮助!


The old Java WSDL classes returned the timezone values as defined here:

https://msdn.microsoft.com/en-US/library/bing-ads-time-zones.aspx

However, the new Java SDK is returning different values. For example, it returns:

GREENWICH_MEAN_TIME_DUBLIN_EDINBURGH_LISBON_LONDON

instead of

GreenwichMeanTimeDublinEdinburghLisbonLondon

Is this changing across the board?

解决方案

We use 'wsimport' to generate proxies for the Bing Ads Java SDK, and you can find details here on GitHub. The UPPER_CASE_UNDERSCORE pattern you see is generated by default by wsimport for all value sets e.g. TimeZoneType in the Customer Management service and BudgetLimitType in the Campaign Management service. Using an IDE such as Eclipse, the possible values should be available through intellisense. 

The values you see documented are accepted by the service when a string is expected (not value set). For example when adding a campaign you would set the time zone with one of the CamelCase values you see documented here on MSDN

Campaign campaign = new Campaign();
 campaign.setName("Winter Clothing " + System.currentTimeMillis());
 campaign.setDescription("Winter clothing line.");
 campaign.setBudgetType(BudgetLimitType.MONTHLY_BUDGET_SPEND_UNTIL_DEPLETED);
 campaign.setMonthlyBudget(1000.00);
 campaign.setTimeZone("PacificTimeUSCanadaTijuana");
 campaign.setDaylightSaving(true);


I hope this helps!


这篇关于Java SDk返回的时区数据在任何地方都没有定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆