How do I set a cookie in for a soap request?

329 views Asked by At

This is the first time I am getting with soap (Ruby's soap4r). I am trying to develop and plugin for vShpere Client. (ruby sdk http://communities.vmware.com/thread/162318).

I would like to know how I can set a cookie for a SOAP request ?

1

There are 1 answers

0
Prakash Raman On BEST ANSWER

Found a way to do it.

driver = SOAP::RPC::Driver.new('x','y','c')
cookies = driver.streamhandler.client.cookie_manager.cookies
cookie = cookies[0]
cookie.value = <value>

That does it, it might be a bad hack, but works reliably enough.