Hi Jeff,

Thanks for the reply.  Yeah unfortunately im not an expert on cookies myself.  In fact, as you probably guessed, I'm pretty new to web services and soap in general.   I can't really say what would be good defaults on new cookies added through your client API, but, like you said, all I am trying to do is set a cookie to a specific value that was returned to me from a login call (strangely, it does not set the cookie for you, instead it just returns a session ID that it expects you to set it).  But yes, I think having a way to set and get cookies via the client API would be a good idea.  But thats just IMHO :-)

-David 

On Wed, Mar 18, 2009 at 5:29 AM, Jeff Ortel <jortel@redhat.com> wrote:
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