Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOF Exception Ksoap2-3.4.0 #207

Open
GoogleCodeExporter opened this issue Jul 9, 2015 · 10 comments
Open

EOF Exception Ksoap2-3.4.0 #207

GoogleCodeExporter opened this issue Jul 9, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.Run app
2.
3.

What is the expected output? What do you see instead?
Get the result from web Service

What version of the product are you using? On what operating system?
3.4.0

Please provide any additional information below.
java.io.EOFException
libcore.io.Streams.readAsciiLine(Streams.java:203)
libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:27
4)
libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.jav
a:486)
org.ksoap2.transport.ServiceConnectionSE.getResponseCode(ServiceConnectionSE.jav
a:103)

Original issue reported on code.google.com by [email protected] on 4 Feb 2015 at 9:27

@GoogleCodeExporter
Copy link
Author

Are there any solutions to this error?
Could someone help me out please?

Original comment by [email protected] on 4 Feb 2015 at 9:31

@GoogleCodeExporter
Copy link
Author

Report the same error! 

Original comment by benoffi7 on 30 Apr 2015 at 7:33

@GoogleCodeExporter
Copy link
Author

Hi benoffi7,

I solved this problem by adding this line in HttpTransferSE, Line 172:
System.setProperty("http.keepAlive", "false"); //possible eof exception problem
        connection.setRequestProperty("Accept-Encoding", "gzip");

Honestly I don't know which are the drawbacks but for me it works now without 
problem. I read some threads in which it was written that if you don't keep the 
connection alive then it will take longer to make requests. For me the 
connection with the server is acceptable fast so I let it like this.


Original comment by [email protected] on 4 May 2015 at 9:13

@GoogleCodeExporter
Copy link
Author

Hi! Can you send me a JAR with that line? 

Thanks a lot!!!

Original comment by benoffi7 on 4 May 2015 at 6:56

@GoogleCodeExporter
Copy link
Author

Hi,

I attached the jar, hope it helps. :)

Good luck!

Original comment by [email protected] on 4 May 2015 at 7:21

Attachments:

@GoogleCodeExporter
Copy link
Author

Thaaaaaaaanks a lot!!! You save my day!!!

Original comment by benoffi7 on 4 May 2015 at 7:22

@GoogleCodeExporter
Copy link
Author

don't thank me :) test it first :D. 


Original comment by [email protected] on 4 May 2015 at 7:23

@GoogleCodeExporter
Copy link
Author

Please do not attach jar files here. They are not offical releases and the 
project has no control over the content. Anything could be in there. If you 
want this in an official release please send a pull request ... 

Also this specific sort of setting can be done via your our code as well. You 
do NOT need to path the actual source code of ksoap2-android.

Original comment by [email protected] on 4 May 2015 at 8:09

@GoogleCodeExporter
Copy link
Author

How we can add 

System.setProperty("http.keepAlive", "false"); //possible eof exception problem
connection.setRequestProperty("Accept-Encoding", "gzip");

in our code?


SoapObject request = new SoapObject(app.NAMESPACE, metodo);

request.addProperty(app.param_sucursal, sucursal);
request.addProperty(app.param_cuenta, cuenta);

SoapSerializationEnvelope envelope = new 
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(app.URL);

androidHttpTransport.debug = true;

List<HeaderProperty> headerList = new ArrayList<HeaderProperty>();
headerList.add(new HeaderProperty("Authorization", "Basic " + 
org.kobjects.base64.Base64.encode(app.user.getBytes())));

androidHttpTransport.call(app.SOAP_ACTION, envelope, headerList);

Original comment by benoffi7 on 4 May 2015 at 8:17

@GoogleCodeExporter
Copy link
Author

I deleted the attachment, sorry for that, i was online and saw the question, so 
i posted a quick solution.

@benoffi7
I downloaded the ksoap2 sources from git, added them to my project, and changed 
the line that I sent you. This is what I did, maybe there are also other ways, 
but I don't know the library so didn't knew what other settings could be done.

Original comment by [email protected] on 5 May 2015 at 7:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant