Tip for "Bad Request" error with Bing

200 views
Skip to first unread message

Ken Kick

unread,
Jun 26, 2014, 2:21:26 PM6/26/14
to zeta-resou...@googlegroups.com

I found that you MUST perform your API registration\subscription tasks in a specific order before the Translate API will work correctly.

  1. Register application (get your clientId and Secret)
  2. Subscribe to Data > Microsoft Translator

If you are getting the "Bad Request" error and you are sure that your CientID and Secret key is good AND your subscription is not maxed out, than most likely you had registered your app AFTER subscribing to the data.  In which case, you simply go in and CANCEL your Ms Translator data subscription.  Then, go back and subscribe to it again and you should then be ready to rock-n-roll.


calibreb...@gmail.com

unread,
Mar 12, 2017, 9:26:21 PM3/12/17
to Zeta Resource Editor
Thanks for this info. Just one question though, how do you "cancel" your MS Translate data subscription? I've been searching all over the azure site, and cannot find an option to do this.

Brad Vrabete

unread,
Oct 29, 2020, 11:11:31 AM10/29/20
to Zeta Resource Editor
Hi there,

I have followed the steps for creating a Bing translation API key. But I'm getting the error: The remote server returned an error: (400) Bad Request.

The full details below



ZetaLongPaths.ZlpSimpleFileAccessProtectorException

-----------------

Error during operation, tried more than 3 times.

-----------------

at ZetaLongPaths.ZlpSimpleFileAccessProtector.Protect[T](Func`1 func, ZlpSimpleFileAccessProtectorInformation info) in c:\P\ZP\16.0\ZetaProducerReferences\Externals\ZetaVoyagerLibrary\Externals\ZetaLongPaths\Source\Runtime\ZlpSimpleFileAccessProtector.cs:line 174
   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.Azure.AzureTranslationEngine.ZetaResourceEditor.RuntimeBusinessLogic.Translation.ITranslationEngine.GetSourceLanguages(String appID) in c:\P\ZetaResourceEditor\Source\RuntimeBusinessLogic\Translation\Azure\AzureTranslationEngine.cs:line 42
   at ZetaResourceEditor.UI.Translation.QuickTranslationForm.InitiallyFillLists() in c:\P\ZetaResourceEditor\Source\Main\UI\Translation\QuickTranslationForm.cs:line 88
   at ZetaResourceEditor.UI.Translation.QuickTranslationForm.DoInitiallyFillListsAndFillItemToControls() in c:\P\ZetaResourceEditor\Source\Main\UI\Translation\QuickTranslationForm.cs:line 224

ZlpSimpleFileAccessProtectorException
{
Message="Error during operation, tried more than 3 times.",
Data=
[
[....]
]
,
InnerException=WebException
{
Status=ProtocolError,
Response=HttpWebResponse
{
IsMutuallyAuthenticated=False,
Cookies=CookieCollection
{
IsReadOnly=True,
Count=0,
IsSynchronized=False,

},
Headers=WebHeaderCollection
{
Count=4,
Keys=KeysCollection,
AllKeys=String[],
},
SupportsHeaders=True,
ContentLength=264,
ContentEncoding="",
ContentType="text/html; charset=utf-8",
CharacterSet="utf-8",
Server="",
LastModified=29/10/2020 15:09:49,
StatusCode=BadRequest,
StatusDescription="Bad Request",
ProtocolVersion=Version
{
Major=1,
Minor=1,
Build=-1,
Revision=-1,
MajorRevision=-1,
MinorRevision=-1
},
ResponseUri=Uri
{
AbsolutePath="/v2/Http.svc/GetLanguagesForTranslate",
LocalPath="/v2/Http.svc/GetLanguagesForTranslate",
HostNameType=Dns,
IsDefaultPort=True,
IsFile=False,
IsLoopback=False,
PathAndQuery="/v2/Http.svc/GetLanguagesForTranslate",
Segments=String[],
IsUnc=False,
Port=443,
Query="",
Fragment="",
Scheme="https",
IsAbsoluteUri=True,
UserEscaped=False,
UserInfo=""
},
Method="GET",
IsFromCache=False
},
Message="The remote server returned an error: (400) Bad Request.",
Data=
[
]
,
InnerException=null,
TargetSite=RuntimeMethodInfo: GetResponse,
StackTrace="   at System.Net.HttpWebRequest.GetResponse()\\r\\n   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.Azure.AzureTranslationEngine.<>c__DisplayClass19_0.<ZetaResourceEditor.RuntimeBusinessLogic.Translation.ITranslationEngine.GetSourceLanguages>b__0() in c:\\P\\ZetaResourceEditor\\Source\\RuntimeBusinessLogic\\Translation\\Azure\\AzureTranslationEngine.cs:line 49\\r\\n   at ZetaLongPaths.ZlpSimpleFileAccessProtector.Protect[T](Func`1 func, ZlpSimpleFileAccessProtectorInformation info) in c:\\P\\ZP\\16.0\\ZetaProducerReferences\\Externals\\ZetaVoyagerLibrary\\Externals\\ZetaLongPaths\\Source\\Runtime\\ZlpSimpleFileAccessProtector.cs:line 161",
HelpLink=null,
Source="System",
HResult=-2146233079
},
TargetSite=RuntimeMethodInfo: Protect,
StackTrace="   at ZetaLongPaths.ZlpSimpleFileAccessProtector.Protect[T](Func`1 func, ZlpSimpleFileAccessProtectorInformation info) in c:\\P\\ZP\\16.0\\ZetaProducerReferences\\Externals\\ZetaVoyagerLibrary\\Externals\\ZetaLongPaths\\Source\\Runtime\\ZlpSimpleFileAccessProtector.cs:line 174\\r\\n   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.Azure.AzureTranslationEngine.ZetaResourceEditor.RuntimeBusinessLogic.Translation.ITranslationEngine.GetSourceLanguages(String appID) in c:\\P\\ZetaResourceEditor\\Source\\RuntimeBusinessLogic\\Translation\\Azure\\AzureTranslationEngine.cs:line 42\\r\\n   at ZetaResourceEditor.UI.Translation.QuickTranslationForm.InitiallyFillLists() in c:\\P\\ZetaResourceEditor\\Source\\Main\\UI\\Translation\\QuickTranslationForm.cs:line 88\\r\\n   at ZetaResourceEditor.UI.Translation.QuickTranslationForm.DoInitiallyFillListsAndFillItemToControls() in c:\\P\\ZetaResourceEditor\\Source\\Main\\UI\\Translation\\QuickTranslationForm.cs:line 224",
HelpLink=null,
Source="ZetaLongPaths",
HResult=-2146233088
}
-->The remote server returned an error: (400) Bad Request.

System.Net.WebException

-----------------

The remote server returned an error: (400) Bad Request.

-----------------

at System.Net.HttpWebRequest.GetResponse()
   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.Azure.AzureTranslationEngine.<>c__DisplayClass19_0.<ZetaResourceEditor.RuntimeBusinessLogic.Translation.ITranslationEngine.GetSourceLanguages>b__0() in c:\P\ZetaResourceEditor\Source\RuntimeBusinessLogic\Translation\Azure\AzureTranslationEngine.cs:line 49
   at ZetaLongPaths.ZlpSimpleFileAccessProtector.Protect[T](Func`1 func, ZlpSimpleFileAccessProtectorInformation info) in c:\P\ZP\16.0\ZetaProducerReferences\Externals\ZetaVoyagerLibrary\Externals\ZetaLongPaths\Source\Runtime\ZlpSimpleFileAccessProtector.cs:line 161

WebException
{
Status=ProtocolError,
Response=HttpWebResponse
{
IsMutuallyAuthenticated=False,
Cookies=CookieCollection
{
IsReadOnly=True,
Count=0,
IsSynchronized=False,

},
Headers=WebHeaderCollection
{
Count=4,
Keys=KeysCollection
{
Count=4
},
AllKeys=String[]
{
Length=4,
LongLength=4,
Rank=1,
,
IsReadOnly=False,
IsFixedSize=True,
IsSynchronized=False

"X-MS-Trans-Info",
"Content-Length",
"Content-Type",
"Date"
},
},
SupportsHeaders=True,
ContentLength=264,
ContentEncoding="",
ContentType="text/html; charset=utf-8",
CharacterSet="utf-8",
Server="",
LastModified=29/10/2020 15:09:49,
StatusCode=BadRequest,
StatusDescription="Bad Request",
ProtocolVersion=Version
{
Major=1,
Minor=1,
Build=-1,
Revision=-1,
MajorRevision=-1,
MinorRevision=-1
},
ResponseUri=Uri
{
AbsolutePath="/v2/Http.svc/GetLanguagesForTranslate",
LocalPath="/v2/Http.svc/GetLanguagesForTranslate",
HostNameType=Dns,
IsDefaultPort=True,
IsFile=False,
IsLoopback=False,
PathAndQuery="/v2/Http.svc/GetLanguagesForTranslate",
Segments=String[]
{
Length=4,
LongLength=4,
Rank=1,
,
IsReadOnly=False,
IsFixedSize=True,
IsSynchronized=False

"/",
"v2/",
"Http.svc/",
"GetLanguagesForTranslate"
},
IsUnc=False,
Port=443,
Query="",
Fragment="",
Scheme="https",
IsAbsoluteUri=True,
UserEscaped=False,
UserInfo=""
},
Method="GET",
IsFromCache=False
},
Message="The remote server returned an error: (400) Bad Request.",
Data=
[
]
,
InnerException=null,
TargetSite=RuntimeMethodInfo: GetResponse,
StackTrace="   at System.Net.HttpWebRequest.GetResponse()\\r\\n   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.Azure.AzureTranslationEngine.<>c__DisplayClass19_0.<ZetaResourceEditor.RuntimeBusinessLogic.Translation.ITranslationEngine.GetSourceLanguages>b__0() in c:\\P\\ZetaResourceEditor\\Source\\RuntimeBusinessLogic\\Translation\\Azure\\AzureTranslationEngine.cs:line 49\\r\\n   at ZetaLongPaths.ZlpSimpleFileAccessProtector.Protect[T](Func`1 func, ZlpSimpleFileAccessProtectorInformation info) in c:\\P\\ZP\\16.0\\ZetaProducerReferences\\Externals\\ZetaVoyagerLibrary\\Externals\\ZetaLongPaths\\Source\\Runtime\\ZlpSimpleFileAccessProtector.cs:line 161",
HelpLink=null,
Source="System",
HResult=-2146233079
}
Ignoring inner exception because of previous OutOfMemoryException. See https://stackoverflow.com/a/25010668/107625


Reply all
Reply to author
Forward
0 new messages