android中代理背后的ksoap超时
我尝试了 http://www.helloandroid 中的示例。 com/tutorials/using-ksoap2-android-and-parsing-output-data 从 wsdl 服务获取请求和响应。当我尝试无代理时它工作正常。但是当我在代理后面工作时,我得到“操作超时:请求时间失败:java.net.SocketException”有什么方法可以将代理设置为SoapObject或Soap信封?
i tried the example from http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data to get request and response from a wsdl service. its working fine when i tried in a proxyless. but when i work behind proxy,i get "The operation timed out:request time failed: java.net.SocketException" is there any way to set proxy to SoapObject or Soap Envelop?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Ksoap 不能在代理后面工作。为了使其发挥作用..
从 sourceforge 下载 HttpTransportSE.java 和 ServiceConnectionSE.java。
使用 HttpTransportSE 和 ServiceConnectionSE 创建包。
在 ServiceConnectionSE 构造函数中:
现在无论我们在哪里调用 HttpTransportSE.call() 方法,请确保它指向您自己的包含这两个文件的包。
Ksoap does not work behind a proxy. inorder to make that working..
download the HttpTransportSE.java and ServiceConnectionSE.java from sourceforge.
Create a package with HttpTransportSE and ServiceConnectionSE.
In ServiceConnectionSE constructor:
now wherever we call HttpTransportSE.call()method make sure that it points to ur own package which has this two files.
大家好,最新版本的KSOAP2.6.5[测试并验证]已修复代理身份验证问题。
HTTPTransportSE
构造函数现在接受java.net.Proxy
实例作为参数以及 URL。该方法将是这样的HttpTransportSE httpTransport=new HttpTransportSE(代理,URL);
如果您的代理已配置并且需要身份验证,则使用
Authenticator
类来设置您的代理凭据并取得成功。 HTH,如果不给我回信Hi Everyone , The latest version of KSOAP2.6.5 [Tested it and verified it] has fix for the proxy authentication issue . The
HTTPTransportSE
constructor now acceptsjava.net.Proxy
instance as a parameter along with URL. The method will be likeHttpTransportSE httpTransport=new HttpTransportSE(proxy,URL);
If your proxy is configured and if it requires authentication then use
Authenticator
class to setup your proxy credentials and have success. HTH , if not write me back据我所知,你必须在 Android 操作系统设置中设置代理,它就会正常工作。
As far as I know you have to set up the proxy in android operating system settings themselves and it will work fine.
换成这个..
Replace with this..