scientist2009 / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Respons in wrong output #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. After sending the request with envelope:
<?xml version="1.0" encoding="utf-8"?><v:Envelope 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:d="http://www.w3.org/2001/XMLSchema" 
xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body><SendTextToFax xmlns="http://www.webserviceX.NET">
<FromEmail>mail@gmail.com</FromEmail><Subject>Subject</Subject><FaxNumber>123456
7</FaxNumber><BodyText>SomeText.</BodyText><ToName>Obama</ToName></SendTextToFax
></v:Body></v:Envelope>
i receive the respons which looks like:
�������������`I�%&/m�{J�J��t��`$�
�@�����iG#)�*��eVe]f@�흼��{���{��;�N'���
��?\fdl��J�ɞ!���?~|?"��ez��MQ-?�hw��Q�/��
�X^|�Ѻ=�>���8z�T�����2/�U��+��>��yۮݽ�
L��"k��>W��]�r7ח�~���k

What version of the product are you using? On what operating system?
Using version 2.6.5.

The code:
private String METHOD_NAME = "SendTextToFax";
    private String NAMESPACE = "http://www.webserviceX.NET";
    private String SOAP_ACTION = "http://www.webserviceX.NET/SendTextToFax";
    private static final String URL = "http://www.webservicex.net/fax.asmx";
    private HttpTransportSE _ht;

        SoapObject _client = new SoapObject(NAMESPACE, METHOD_NAME);
        _client.addProperty("FromEmail", fromEmail);
        _client.addProperty("Subject", subject);
        _client.addProperty("FaxNumber", faxNumber);
        _client.addProperty("BodyText", bodyText);
        _client.addProperty("ToName", toName);
        SoapSerializationEnvelope _envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        _envelope.dotNet = true;
        _envelope.setAddAdornments(false); 
        _envelope.setOutputSoapObject(_client);
        _envelope.implicitTypes = true; 

        System.setProperty("http.keepAlive", "false");
        _ht = new HttpTransportSE(URL);
        _ht.debug = true;
        _ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
        _ht.call(SOAP_ACTION, _envelope);

The last call returns the org.xmlpull.v1.XmlPullParserException

Any ideas?

Thanks in advance

Jeroen Vormer

Original issue reported on code.google.com by jvor...@gmail.com on 11 Jun 2012 at 12:25

GoogleCodeExporter commented 9 years ago
I've tried the same request with SoapUI. Than I get the correct respons...

Original comment by jvor...@gmail.com on 11 Jun 2012 at 4:12

GoogleCodeExporter commented 9 years ago
Seems like the response comes encoded with gzip or something, maybe is the same 
problem i had, can you please share the error message you get from 
XmlPullParserException?

Original comment by jose.cas...@gmail.com on 11 Jun 2012 at 4:22

GoogleCodeExporter commented 9 years ago
This is the error:
48:05.957: W/System.err(300): org.xmlpull.v1.XmlPullParserException: 
unterminated entity ref (position:TEXT ¬‹ ���������� 
���` I�...@1:18 in java.io.InputStreamReader@44f2d2f8)

Original comment by jvor...@gmail.com on 11 Jun 2012 at 4:25

GoogleCodeExporter commented 9 years ago
The hint that it might be encoded sounds good. Try getting it decoded.

Original comment by mosa...@gmail.com on 11 Jun 2012 at 5:21

GoogleCodeExporter commented 9 years ago
Yep, it might be the same issue i had that the response is coming encoded and 
the HttpTransprtSE class is not detecting it due to the case of the Header 
Content-Encode. Probably you should try to use the latest snapshot from 
repository to check it

Original comment by jose.cas...@gmail.com on 11 Jun 2012 at 10:07

GoogleCodeExporter commented 9 years ago
"Probably you should try to use the latest snapshot from repository to check 
it" ?
Could you explain ?

Original comment by jvor...@gmail.com on 12 Jun 2012 at 9:34

GoogleCodeExporter commented 9 years ago
What i meant is that you need to download the latest version of the source code 
from the repository http://github.com/mosabua/ksoap2-android/tree/ and compile 
the code via maven. This version (under development) has one change that might 
solve your problem.

Original comment by jose.cas...@gmail.com on 12 Jun 2012 at 2:42

GoogleCodeExporter commented 9 years ago
was that resolved ?

Original comment by md.hasa...@gmail.com on 21 Aug 2012 at 5:32

GoogleCodeExporter commented 9 years ago
I encountered the save issue today. Getting symbols in the response. Downloaded 
ksoap2 v2.5.7 lib and solved the problem.

Original comment by santiban...@gmail.com on 21 Aug 2012 at 5:57

Attachments:

GoogleCodeExporter commented 9 years ago
I am going to delete this jar since I can not verify what it contains... please 
use a latest version of ksoap2-android or provide a pull request that fixes it.

Original comment by mosa...@gmail.com on 21 Aug 2012 at 7:55

GoogleCodeExporter commented 9 years ago
Try the latest release..

Original comment by mosa...@gmail.com on 21 Aug 2012 at 7:56

GoogleCodeExporter commented 9 years ago
It's October 17,2012 and this problem not solved till now.....

Original comment by ishratkh...@gmail.com on 17 Oct 2012 at 11:05

GoogleCodeExporter commented 9 years ago
And you have still not send a pull request with the fix .. 

Come on this does not help. This is an open source volunteer effort. If you 
want something done... help us out.  Nobody that has the problem has provided a 
way to reproduce it not to mention a fix. I do not the time or resources to 
investigate this further. The project lives by the contributions from the 
community and my efforts running the project and doing fixes I need in my 
uses.. 

Original comment by mosa...@gmail.com on 18 Oct 2012 at 5:28

GoogleCodeExporter commented 9 years ago
Ping... can you please try with the latest 3.0.0-RC.4 .. it might resolve the 
issue.

Original comment by mosa...@gmail.com on 12 Nov 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Tested on API8 and 15. Fixed in 3.0.0-RC.4 version. Working like a charm. :)

Original comment by mangarso...@gmail.com on 24 Jan 2013 at 1:10

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 5 Mar 2013 at 7:46

GoogleCodeExporter commented 9 years ago
I am using latest 3.0.0 Ksoap2. Its working well in android 2 versions. But its 
throwing error in Android 4.0 version and 4+ versions. Error is coming in line 

  "androidHttpTransport.call(SOAP_ACTION1, envelope);"

 the error is.
"NetworkOnMainThreadException"

Please help me to solve this issue. The same code working fine in android 2 
versions.

Original comment by Yuvi...@gmail.com on 6 Jun 2013 at 9:39

GoogleCodeExporter commented 9 years ago
Hi, I got it. I added these lines in onCreate function. Its worked..
StrictMode.setThreadPolicy(new 
StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNet
work().penaltyLog().build());
             StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());

Original comment by Yuvi...@gmail.com on 6 Jun 2013 at 12:19