Comments (4)
Can you make a simple repo recreating this bug? That will help the developers tackle this one
from ksoap2-android.
I don't have the time for that now, but I can share what I found by stepping through it.
envelope.bodyOut correctly displays the '@' sign
httpTransport.requestDump incorrectly displays the ascii code '@ ;'
it's happening at line 62 in HttpTransportSE.class:
byte[] requestData = this.createRequestData(envelope, "UTF-8");
when SoapEnvelope is writing to the KXmlSerializer on line 138 of Transport.class:
envelope.write(xw);
somewhere here, the XmlSerializer writer is changin the '@' to '@ ;' on Android 10.0 devices.
I wish I could provide more help!
from ksoap2-android.
Sounds like a framework issue. Have you tried searching for the bug on https://b.android.com?
from ksoap2-android.
hello @Kisty , I ran into this issue again, over a year later.. and instead of asking our vendor if they could change the username to remove the @ sign, I dug deeper into the KSOAP classes.
I found the issue to be the following line, in the KXmlSerializer.class, line 98, it's an IF statement that appears to work with Android 9.0 and below, but has a slightly different behavior on Android 10+
if (c < ' ' || c == '@' || c >= 127 && !this.unicode) {
this.writer.write("&#" + c + ";");
} else {
this.writer.write(c);
}
What is happening here, correct me if I'm wrong, is that if 'unicode' is true, then this entire IF statement should return false and the writer should call this.writer.write(c) instead of this.writer.write("&#" + c + ";");
However, on Android 10+, it seems that we need to encapsulate the OR's and make sure the AND section overshadows the entire IF statement.. for example, when I change this line to the following, it works as intended on Android 10+:
if ((c < ' ' || c == '@' || c >= 127) && !this.unicode) {
this.writer.write("&#" + c + ";");
} else {
this.writer.write(c);
}
Notice I am putting an extra set of brackets over (c < ' ' || c == '@' || c >= 127) so that it will always also check for && !this.unicode..
I don't know why, but with Android 10+, it is evaluating this as if it were (c < ' ' || c == '@') || (c >= 127 && !this.unicode)
Is there any way this could be fixed in the library? I know it hasn't been changed in a while and maybe nobody else runs into this because nobody else is trying to pass an @ sign in a header item string...
I hope it was easy enough to follow, let me know if I can help any...
from ksoap2-android.
Related Issues (20)
- Why getAttributeSafelyAsString Method has return Object-class? HOT 1
- Send List as Request HOT 1
- Transport.USER-AGENT should be dynamically linked to ksoap's version number. HOT 5
- Error: java.net.ProtocolException: unexpected end of stream HOT 2
- Isn't kSOAP2 a little too strict with unique IDs? HOT 1
- Last release doesn't contain okhttp module HOT 3
- Problems of HttpTransportSE.call not returning when server does HOT 3
- HttpsTransportSE throws exception java.net.UnknownHostException: Unable to resolve host "my.host.com": No address associated with hostname HOT 2
- 503 - Repository [id=ksoap2-android-releases] is not available HOT 1
- How to use with OkHttp HOT 11
- HttpTransPortSE - Timeout Not Respected HOT 5
- NoClassDefFoundError: org.ksoap2.serialization.SoapObject API:19 HOT 10
- Soap request changes by device
- Request SOAP response comes empty
- Outdated okhttp dependency HOT 4
- DontKillMyApp Reportar
- Grfans
- Bug
- Dd
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksoap2-android.