ksoap2-android client throwing FileNotFoundException inside [KeepAlive]HttpsTransportSE.call() - android

I am attempting to create an Android (2.2) SOAP client to connect to a SQL Server 2005 XML Web Services endpoint (and of course this requires authentication). My SQL Server endpoint seems to be up and running (it's a simple function which takes a string (varchar(20)) and returns another string; the URL "https://10.1.1.20:444/dt2?wsdl" properly returns the WSDL XML. (I am not using the "?wsdl" part of the URL in my connection string; I just mention it to show the web service is working properly.)
All seems to be working well, until I am inside the call to KeepAliveHttpsTransportSE.call() (using ksoap2-android 2.5.4), and get to HttpTransportSE.class:150, where (ServiceConnection)connection.openInputStream() is called, which in turn calls connection.getInputStream() - that is what throws the FileNotFoundException.
Any idea what's happening here? What is a good next debugging step? Thanks for any input.

See the following question for more detail and the answer to the problem: Getting ParsingError, InvalidSoapActionHeader on SQL Server SOAP request

Related

Send POST request from Android to Symfony backend

I try to send POST requests (like forms) from my Android application to my Symfony backend but when I hit the 'Send' button for example, an Android FileNotFoundException ('http://192.168.1.84/1day-symfony/web/app_dev.php/api/request') is thrown. Maybe it is caused by the rewritten URL.
I do not know how to fix it...
Using Volley fixes the issue of the rewritten URLs.

Consuming .net rest api via android - 400 error

I have created REST service according to this: http://www.asp.net/web-api/overview/older-versions/creating-a-web-api-that-supports-crud-operations
tutorial and a android client according to this: http://www.techrepublic.com/blog/software-engineer/calling-restful-services-from-your-android-app/
I changed the service to receive the json messages, and the connection string to the same that works in the browser, with 10.0.2.2 instead of localhost(according to one of the advices in stackoverflow) - in the browser it works perfectly. When I try to test it on the emulator I get the 400 bad request error. Maybe this is totally wrong way of approaching this, I am confused - would you kindly show me the error in the implementation or the tutorial that could help me with consuming the rest api with android client?

What is Apache-HttpClient/UNAVAILABLE error (Android, Google App Engine)?

I am confronting myself with a problem that I do not know how to interpret. I am doing a project using Android and Google App Engine. When I am trying to save information in Google App Engine's Big Table, directly from the servlet (hardcoded) - the save is performed with no problem. But when I am trying to save data from my Android device, the save is not performed and the log indicates Apache-HttpClient/UNAVAILABLE error. To be more specific:
405 55ms 0kb Apache-HttpClient/UNAVAILABLE (java 1.4)
82.155.246.249 - - [10/Jun/2013:05:20:59 -0700] "POST /servletnamehere HTTP/1.1" 405 306 - "Apache-HttpClient/UNAVAILABLE (java 1.4)" "appnamehere.appspot.com" ms=56 cpu_ms=21 cpm_usd=0.000034 app_engine_release=1.8.0 instance=00c61b117cede3f754aa1ece730dc88287a20199
I have seen that 405 HTTP error appears in the context of a POST method ( "405 errors often arise with the POST method. You may be trying to introduce some kind of input form on the Web site, but not all ISPs allow the POST method necessary to process the form." ) => indeed, I am trying to perform add (the object is a JPA Entity) in the database using a POST method. The data I am receiving from my Android device is serialized, through an input stream (in my case, working with JSON is not an option, these are the specifications).
Also, 306 HTTP error reffers to switch proxy. While the porevious error might be a bit intuitive, this one is beyond my student knowledge.
I have followed the instructions of this tutorial (http://trumpy.cs.elon.edu/joel/sigcse2011/), which is indeed what I need, but I really cannot figure out what I did wrong. I took again the procedure, stept by step, but I don't see the flaw.
Any help will be indeed appreciated. If I should post some code, I'll gladly do it.
Best wishes,
Cropcircles
LATER EDIT:
Now I get 417 HTTP error expectation failed. I have seen that I am supposed to set a certain parameter on false, but this workaround was available only for .NET. Is there anyone who knows what's the correspondent of the following, in Java? I am really really confused.
<system.net>
<settings>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>
This is not an answer, but is too long for a comment and may be helpful, so here goes...
First, it's hard to tell what's going on here because there is limited info. Try to post more of the logging either on the client or on the server. Go to the server console and get more info, for instance, or add debugging in the client. I'd start by trying to make the POST from a debug/testing tool like hurl.it: http://www.hurl.it/ (hurl is a nice web front end to a command line HTTP client named curl, see curl itself if you want a more advanced peek). That way you can test and poke around and make SURE your server side works as you expect with a generic client. Then build other clients (like Android).
Second, "Apache-HttpClient/UNAVAILABLE" is not an error, it's just the user-agent String -- so ignore that part. (UNAVAILABLE is where the version typically is, but some impls don't have access to the version sometimes, it seems.)
Third, the 405 response code IS an error, it means POST is not allowed at the server you are trying to POST to. That can either be because POST is not allowed at all on said server, or you're violating some security policy (such as same origin).
If it's AppEngine, first check the APP you are using and make sure it supports POST (look for info on how to do POST at AppEngine to solve, for instance: google app engine: 405 method not allowed). When you say you can do it directly from a "servlet," do you mean that a POST from a different client works? (Servlet is a server side technology, so that's a little confusing.) If so then make sure your Android app is doing the client part the same way to the same host (multipart vs urlencoded, etc).
For a little more on the security stuff, which could be involved, see this post: Google App Engine + jQuery Ajax = 405 Method Not Allowed.
I've had the same trouble and in my case It was an error due to no write permission on server side area.
I was following an android test to write on a file a value transmitted in async way via POST method.
Apache received the POST request but was not able to write the data on the file due to security permission on it.

Check HTTP request against reliable server

In my android app i keep getting timeouts in the messages between the app and my server.
In an attempt to see if the problem is in the app or my server,
i want to try and Send an HTTP request from my app to
some other server i am sure is up and reliable and then see if i get timeouts.
Is there any server address i can check against?
Thanks in advance!
BTW : i am using a glass Fish servlet for my server
We've successfully sent a simple HTTP GET to google.com -- with a couple of fall-backs (I've also seen internic.org used) in the past, in similar cases.

I got error while calling the .NET web Service with KSOAP2 in android

While I run my emulator to call the .NET web service with KSOAP2 in Android.
I know it reads the HTML file but I don't know how to solve the problem.
org.xmlpull.v1.xmlPullParserException: expected:START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope(position:START_TAG#1:6 in java.io.InputStreamReader#4375fda8)
Are you sure that the response is as expected... Usually I get this error when the response contain some error like "not authorized" for example, so the problem should be somewhere in the request. Anyway, I'd check the response InputStream to see if there is the expected response first -
StreamToString

Categories

Resources