simpligility / ksoap2-android

ksoap2-android - SOAP support for Android
http://simpligility.github.io/ksoap2-android/
Other
544 stars 247 forks source link

Transport.USER-AGENT should be dynamically linked to ksoap's version number. #120

Closed AMarguier closed 5 years ago

AMarguier commented 6 years ago

Hi guys,

in Ksoap2-base / org.ksoap2.transport.Transport.java : constant Transport.USER_AGENT is statically declared as : protected static final String USER_AGENT = "ksoap2-android/2.6.0+";

This is quite confusing when checking/sniffing soap communication between mobile and server. As a result, communication between my server and my mobile device starts with that header :

POST <script>.php?wsdl HTTP/1.1
User-Agent: ksoap2-android/2.6.0+
SOAPAction: getLogin
Content-Type: text/xml;charset=utf-8
Accept-Encoding: gzip
Content-Length: 508
Host: <myhost>:<myhost_port>
Connection: Keep-Alive

<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:Envelope>

Is someone able to do it ? (i would love to take time for this, but i'm stuck in another problem)

mosabua commented 5 years ago

I can just update it with the release.. how about that? Of course we could load on the fly from a property file or so as well.. wanna send a PR?

mosabua commented 5 years ago

https://github.com/simpligility/ksoap2-android/commit/e9e57231ac5fb683f6df5dffbbde3383c2d789bb

What do you think .. this will preserve backwards compatibility to some degree yet add the actual release version..

mosabua commented 5 years ago

If you are ok with this I will cut a release

mosabua commented 5 years ago

3.6.4 has the above change and is released.

massimopasquali commented 4 years ago

Hi,

public class NtlmTransport extends Transport {

the compile told me to declare Abstract, why?

//Pass the headers provided by the user along with the call if (headers != null) { for (int i = 0; i < headers.size(); i++) { HeaderProperty hp = (HeaderProperty) headers.get(i); httppost.addHeader(hp.getKey(), hp.getValue()); } }

HeaderProperty = cannot resolve

tnx