The transport already uses cookielib to round-trip cookies. But, it looks like in this case, you need to add a cookie using the value returned in a previous call, right?
Seeing how there is a need ... I'd like to add a way to set and get cookies to the client api but don't want to tie it to a specific transport implementation (cookiejar and urllib2).
How many of these cookie parameters are generic?
Eg:
import from suds.cookie import Cookie
cookie = Cookie(port="8082", # I'd bet many of these could be defaulted. port_specified=False, domain="127.0.0.1", domain_specified=True, domain_initial_dot=False, path="ISTSessionId", path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest=None)
client.setcookie(cookie) cookies = client.getcookies()
Would this be a good idea?
Thoughts, suggestions?
I'm not an expert on cookies :)
David Bunch wrote:
Is this not the correct way set a cookie in suds?
# Create session cookie. oizysSessionCookie = cookielib.Cookie(version=None, name="ASP.NET_SessionId",
value=self.loginCredentials.session_id, port="8082", port_specified=False, domain="127.0.0.1", domain_specified=True, domain_initial_dot=False, path="ISTSessionId", path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest=None) # Add cookie to clients commandClient = Client(commandUrl)
commandClient.options.transport.cookiejar.set_cookie(oizysSessionCookie) monitorClient = Client(monitorUrl)
monitorClient.options.transport.cookiejar.set_cookie(oizysSessionCookie)
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list