0
如何在android請求中添加自定義[回調]字符串?如何在android請求中添加自定義[回調]字符串?
以下是我在android中調用soap webservice的代碼並獲得json響應。我怎樣才能在android中通過呼叫back=?callback=jQuery15
?
關於相同的任何想法如何在url中包含callback-jquery15
參數?
private static String SOAP_ACTION1 = "http://www.example.com/NewsServices/AuthenticateApplication";
private static String NAMESPACE = "http://www.example.com/NewsServices/";
private static String METHOD_NAME1 = "AuthenticateApplication";
private static String URL = "http://www.example.com/services/webServices/MobileServices/exampleMobilejson.asmx";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);
request.addProperty("xyz", "xyzaa");
request.addProperty("abc", "abcxx");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION1, envelope);
SoapObject result = (SoapObject) envelope.bodyIn;
Toast.makeText(getApplicationContext(), result.toString(),
Toast.LENGTH_LONG).show();
txtCel.setText(result.getProperty(0).toString());
但我的問題是我的web接受調用參數後,我如何可以使用例如:
http://www.example.com/services/webServices/MobileServices/exampleMobileJson.asmx/AuthenticateApplication?callback=jQuery15&xyz=xyzaa&abc=abcxx
那麼「?」怎麼樣?它是一個http://www.example.com/services/webServices/MobileServices/exampleMobileJson.asmx/AuthenticateApplication**?callback=**jQuery15&xyz=xyzaa&abc=abcxx –
任何相同的即時通訊的例子不完全得到你和是的,它使用對於jsonp,但現在我想在java中使用eclips,所以我該如何使用它? –