Quantcast
Channel: Microsoft Translator User Forum (Including Bing Translator) forum
Viewing all articles
Browse latest Browse all 529

Soap Request Microsoft Translator on Android

$
0
0

Hey guys, 

I am trying to use the Microsoft Translator with the SoapInterface on Android. 

But it doesn't seem to work with the translate service. 

i always get this response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">ArgumentException: Invalid appId&#xD;
Parameter name: appId : ID=0728.V2_Soap.Translate.38F4C8DF</faultstring></s:Fault></s:Body></s:Envelope>

I have no idea what's wrong. 

My Request looks like this:

{

........{

 String authtoken=createAccessToken(clientId, clientSecret);

request.addProperty("Authorization", authtoken); request.addProperty("text",textToTranslate); request.addProperty("from","de"); request.addProperty("to","en"); envelope.setOutputSoapObject(request); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle="UTF-8"; transport.debug = true; transport.call(soapAction, envelope);

}

   

 public static String createAccessToken(String clientId, String  clientSecret){

      String result="Bearer "+"grant_type=client_credentials&client_id="+URLEncoder.encode(clientId)+"&client_secret="+URLEncoder.encode(clientSecret)+"&scope=http://api.microsofttranslator.com";
      return result;
     }.....

}


In my method createAccessToken, i try to create a token because appId is not valid anymore. Could someone help me?

thx a lot 






Viewing all articles
Browse latest Browse all 529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>