迁移后,微软在必应翻译上提供少量功能的美好时光已经一去不复返了。新的账号密钥只对新的服务根有效:
https://api.datamarket.azure.com/Data.ashx/Bing/MicrosoftTranslator/v1 而不是像这样的东西:
http://api.microsofttranslator.com/V1/SOAP.svc或者:
http://api.microsofttranslator.com/V1/SOAP.svc这还不是结束。当我尝试向它添加服务引用时,VS只是说:
EntityType 'Microsoft.Translation' has no key defined. Define the key for this EntityType.或者在权限上抛出异常。
在此之前,我尝试使用订阅附带的Helper类。我花了很长时间来修改在WP8上使用的代码-关于System.Data.Services.Client上的一些问题(客户端上WCF5造成的一些不兼容?)和异步调用。结果是:
System.InvalidOperationException:There is a type mismatch between the client and the service. Type 'Microsoft.Translation' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client.我检查了响应,没有发现任何错误:
After the migration, gone are the good old days when Microsoft provides a handful of functions on Bing Translation. And new account keys are only valid to the new service root:
https://api.datamarket.azure.com/Data.ashx/Bing/MicrosoftTranslator/v1 而不是像这样的东西:
http://api.microsofttranslator.com/V1/SOAP.svc或者:
http://api.microsofttranslator.com/V1/SOAP.svc这还不是结束。当我尝试向它添加服务引用时,VS只是说:
EntityType 'Microsoft.Translation' has no key defined. Define the key for this EntityType.或者在权限上抛出异常。
在此之前,我尝试使用订阅附带的Helper类。我花了很长时间来修改在WP8上使用的代码-关于System.Data.Services.Client上的一些问题(客户端上WCF5造成的一些不兼容?)和异步调用。结果是:
System.InvalidOperationException:There is a type mismatch between the client and the service. Type 'Microsoft.Translation' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client.我检查了响应,没有发现任何错误:
Microsoft Translator https://api.datamarket.azure.com/Data.ashx/Bing/MicrosoftTranslator/v1/Translate?Text='hello'&To='nl' 2012-11-22T23:20:10Z https://api.datamarket.azure.com/Data.ashx/Bing/MicrosoftTranslator/v1/Translate?Text='hello'&To='nl'&$skip=0&$top=1 Translation 2012-11-22T23:20:10Z Hallo (Sorry but the xml doesn't display properly.)我甚至尝试使用传统的方法访问OData,但都是徒劳的。说实话有点生气..。
我已经用谷歌搜索了足够多,但仍然找不到新的Bing翻译器界面的解决方案。有没有人和我的有类似的问题?提前谢谢。
我甚至尝试使用传统的方法访问OData,但都是徒劳的。说实话有点生气..。
我已经用谷歌搜索了足够多,但仍然找不到新的Bing翻译器界面的解决方案。有没有人和我的有类似的问题?提前谢谢。
发布于 2012-11-27 21:29:41
这里有一个关于如何在Windows phone7中做到这一点的教程:http://blogs.msdn.com/b/translation/p/wp7translate.aspx
确保在Azure上正确获取您的客户端ID和客户端密钥--为此,请在https://datamarket.azure.com/developer/applications注册您的应用程序
请使用你在此处注册的应用的客户端ID和客户端密码,而不是将Azure帐户作为一个整体使用。
此外,如果您收到错误,最好确保您的translator订阅处于活动状态。您可以通过以下地址进行检查:https://datamarket.azure.com/account/datasets
https://stackoverflow.com/questions/13521607
复制相似问题