My first time posting a question here so please do not mind my mistakes here.
I'm currently making an android application fetching and sending information from a .asmx web service.
Everything goes well with the ksoap2 library and am using HttpTransportSE to call the web service. So now what I'm trying to do is to use the HttpsTransportSE to call the web service over Https. I got java.security.cert.certpathvalidatorexception trustanchor for certpath not found exception.
I have the server certificate in .pfx , .jks and .bks format.
My questions is what do i do with it to make my HttpsTransportSE call to be success?
I've read around with articles using custom SSLSocketFactory but am still not sure how to implement it in my application.
Thanks in advance for any suggestion/advices
your ksoap library is not having the class HttpsTransportSE. you can downlaod the ksoap library of latest version "ksoap2-android-assembly-2.6.5-jar-with-dependencies". It has in built HttpsTransportSE.
Related
I have spend near about 3 days in this issue of No Time error of Volley,
I am calling 10 web APIs sequentially, at 4th web API I am getting No Connection error of volley, out of 12 there are specifically 4 web APIs which are giving me same error(tries asynchronous as well).
I tried same by Async Task using Http Client getting Socket Time out error for the same web APis.
Note : All these web APIs are working in IOS as well as postman properly.
Can any one please let me know that this is the android side issue or from server side, if its of android please tell me the solution , how can I get rid of it?
I have resolved this issue after doing lots of work around.
Issue was of SSL Certification, As volley doesn't support SSL so need to allow externally.
To allow SSL Refer : here Create a HttpsTrustManager class that implements X509TrustManager:
such as E/dalvikvm(2193): Could not find class 'org.ksoap2.transport.AndroidHttpTransport', of android httpTransport and what to write in place of "input" request.addProperty("input", searchNameString); I want to get the result by calling web service to the android app but I could not able to display it please help me on how to retrieve result from the webservice and also how to display to the android app. Please help me on this.
Prefer URL which is post question by me.
create soap envelope with security header in android using ksoap2
If your ksoap2 library is not working fine then change another kshoap2 library.
You use AndroidHttpTransportSE instead of AndroidHttpTransport.
So I finally managed https connection with self-signed certificate on Android to work. But now I have maybe even bigger problem. I have a SOAP webservice on server and only option which I found on internet for using SOAP with Android, is utilize ksoap2 library. Problem is, that for https connection I am using a Apache HttpClient (org.apache.http.client.HttpClient) with added custom trust store. Ksoap2 itself has class HttpsTransportSE, but if I use this class I got an infamous error "no peer certificate". Is there any way to, let say, extend HttpsTransportSE and add certificate for connection?
Few other things comes to my head as well:
Is there any other SOAP client which could be used on Android?
How demanding is to actually write custom SOAP client? (As far as I know, SOAP communicates with XML, so it should be much of a problem to do a custom parser...or am I missing something?)
Thanks for any comments/answers!
If it is self signed then you can just bypass the Certificate check.
Check this https://stackoverflow.com/a/3457454/893574
It worked for me.
I have an android application calls some web service from my .net project. when I set url to local project works like a charm. but I put same project to cloud without any problem, android can't call web service. what was the diffrence now and before is I did upgrade ksoap 2 2.6.5 and some a bit code..
about ksoap 2. 2.6.5 I changed call function to "androidHttpTransport"
I call about 15 web service all gives me this error >
org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT
but same server same database just web service on local works like a charm.
looking for help to understand and solve the problem.
thanks
I found many examples on Stack Overflow and I just don't know where to start since I have a particular prerequisite:
My Delphi Datasnap Rest server is using ZLibCompression and RSA encryption (in TTransportFilterCollection of DSHTTPWebDispatcher). Is there an Android restful API that can handle those? Any sample that already implements that?
I found this thread Android REST client, Sample? as a good starting point, both lightweight and well-formed clients are presented but is it enough for me?
Thanks in advance for any hint, sample or library that you could point me to.
you can use the Android Rest-Client for sending data to a webservice
see my answer in the post Adding body of call to POST using HttpURLConnection
I just used the proxy generator from Danasnap server TDSProxyGenerator component (http://yourserver:port/proxy/java_android.zip) and added this code to my android project...
I had to search for the DSRESTSSLFactory.java file that is not generated by the proxy (but required !!), i found it in a demo from embarcadero, and from that point the communication is entirely handled, all accessible procedures are publicated, and really really simple to use...