Closed GoogleCodeExporter closed 8 years ago
I'm getting an error in this line :
client.setCookies(connection.getConnection(), cj);
The error is :
The method getConnection() is undefined for the type ServiceConnectionSE
How can i solve this problem ?
Original comment by thoma...@gmail.com
on 8 Oct 2010 at 8:20
getConnection you should change source code add get mothod
my change source code see attachments
Original comment by edob...@gmail.com
on 9 Oct 2010 at 12:45
Attachments:
Thanks for the replay, but i dont get it.
What shall i change ?
Can you add an exsample, please ?
Original comment by thoma...@gmail.com
on 11 Oct 2010 at 1:01
Please supply a patch against the latest version on github at mosabua or create
clone and pull request.
Original comment by mosa...@gmail.com
on 12 Oct 2010 at 5:33
Original comment by mosa...@gmail.com
on 12 Oct 2010 at 6:58
Original comment by mosa...@gmail.com
on 21 Oct 2010 at 4:47
Markl is currently looking at implementing this for his needs and I will
cooperate with him on it to get it pulled into the project code base and do
another release when its done.
http://groups.google.com/group/ksoap2-android/browse_thread/thread/4eb910ef3f8b8
434
Original comment by mosa...@gmail.com
on 5 Nov 2010 at 3:04
I am in the process of implementing a cookie solution. Unfortunately the sonalb
code is buggy and does not appear to be maintained anymore. Furthermore, it
seems rather bloated for the requirements of this project (and I hate that
Client class - why aren't those methods static? Is it that way so they could be
overridden?) It was converted from a C++ project that was published in Dr.
Dobbs but the original source for that does not seem to be available anymore.
This leaves me believing that a more targeted rewrite would be a cleaner way to
implement this functionality.
Original comment by markr...@gmail.com
on 8 Nov 2010 at 4:12
I assume you are talking about jcookie when you mention sonalb. I was not
thinking of adding another library in. I think it would be sufficient to
expose the connection so that you can over ride the creation of the connection
or at least have some sort of method that allows you to supply further header
elements (including cookies) before the connection is established and in the
same manner get out any header once the result was received. Then users can use
jcookie or whatever else to set up their header but they dont have to and we
wont impose that library on the many other users that have no need for cookies
or further header stuff..
Makes sense?
Original comment by mosa...@gmail.com
on 8 Nov 2010 at 4:48
I see what you are getting at. I have a working prototype that I am currently
testing. Part of the problem with the cookies is that there are three
specifications all which vary slightly. I didn't want to write code to parse
the cookies or the code to decide if a cookie should be sent to a particular
web site. This seemed highly prone to error so I was looking for something
already built. I discovered that there is a set of Apache classes already
included in Android that seem to address that need. It has a cookie parser and
a "match" function that will establish if the cookie is appropriate for the
target domain and path. See org.apache.http.cookie as a starting point.
My implementation allows one to pass a "cookiejar" to the, for example,
HttpTransportSE class, call method. This will then attach any relevant cookies
to the request and add any received cookies to the jar. One only needs one jar
since it will decide which cookies are relevant. It also handles replacing like
named cookies. The sonalb code attempted something similar but was buggy.
To me, this seemed an intuitive approach. Thoughts?
Original comment by markr...@gmail.com
on 15 Nov 2010 at 7:29
Perfect. Makes sense to me. We just need to ensure that it is properly
documented and maybe has an example on the wiki or somewhere and this should be
good.
Original comment by mosa...@gmail.com
on 15 Nov 2010 at 8:38
I have received a first cut of an implementation from markradb and we are
looking at getting it into the project together.
Original comment by mosa...@gmail.com
on 25 Nov 2010 at 5:58
Issue 42 has been merged into this issue.
Original comment by mosa...@gmail.com
on 7 Dec 2010 at 4:44
Development on this feature is currently ongoing in
https://github.com/markradb/ksoap2-android
Original comment by mosa...@gmail.com
on 7 Dec 2010 at 4:46
This has been pulled into the master branch. I am awaiting some content for a
wiki page showing an example for usage and some testing feedback from markradb.
Once that is available I will cut the new 2.5.3 release and close this issue.
Original comment by mosa...@gmail.com
on 15 Dec 2010 at 6:31
2.5.4 has been released and contains this fix. Documentation on the wiki would
be great but the release is out for now.
Original comment by mosa...@gmail.com
on 15 Feb 2011 at 6:16
Original comment by mosa...@gmail.com
on 15 Feb 2011 at 6:17
Guys, just write code like this.. this will work
//part of the code
ServiceConnection connection = getServiceConnection();
connection.setRequestProperty("User-Agent", "kSOAP/2.0");
// connection.setRequestProperty("User-Agent", "Jakarta Commons-HttpClient/3.1");
connection.setRequestProperty("SOAPAction", soapAction);
connection.setRequestProperty("Content-Type", "text/xml");
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setRequestProperty("Content-Length", "" + requestData.length);
connection.setRequestProperty("Cookie","defaultinst_SAMLart=MDGsMcCYBoEEzZtIBRtVQulSMAfZVva5JH5cSizJPSbht7h9DAUmMmx7");
// use the above statement to set cookies.. this is working fine...
Original comment by rajesh.s...@gmail.com
on 21 Feb 2011 at 11:25
feel free to contact me for any questions reg this
Original comment by rajesh.s...@gmail.com
on 21 Feb 2011 at 11:26
It seems to be that there is a problem with multiple cookies.
The result of this code is setting only the last cookie =(
connection.setRequestProperty("Cookie","cookie1=foo");
connection.setRequestProperty("Cookie","cookie2=bar");
Any ideas, how to solve this problem?
Original comment by scratchboom
on 21 Feb 2011 at 12:41
My Apologies for a newbie question here, I am unable to find (built Jars of)
com.sonalb.net.http.cookie.Client;
com.sonalb.net.http.cookie.CookieJar;
would someone have them built that could provide here, if not please provide a
understanding of how to export them from sources in Eclipse?
Original comment by acor...@gmail.com
on 4 Apr 2011 at 9:10
Why do you think you should use those and not javax.servlet.http ..
Original comment by mosa...@gmail.com
on 4 Apr 2011 at 9:40
Thank You, I would very much like to use javax.servlet.http would you have any
example implementations with KSoap Sessions? I assume KSOAP2 is still used in
that case. So you are saying use Java.servlet.http.HttpSession to manage
session header Requests and Response still with KSoap2?
Original comment by acor...@gmail.com
on 4 Apr 2011 at 10:16
Sorry.. I have not implementation. Ask on the mailing list.
Original comment by mosa...@gmail.com
on 4 Apr 2011 at 10:56
Original issue reported on code.google.com by
edob...@gmail.com
on 14 Jul 2010 at 6:00