PBGetCookies PowerScript function
Description
Gets the cookies
associated with a .NET Web service that you invoke from a proxy
object.
Syntax
1 |
<span>proxyObj</span>.<span>PBGetCookies</span> ( <span>URI</span> ) |
Argument |
Description |
---|---|
proxyObj |
The proxy object that you deploy from |
URI |
The URI of the Web service that you invoke |
Return Values
SoapPBCookie[ ]. An
array of an instance of the SoapPBCookie class.
Usage
The SoapPBCookie class is defined in the pbwsclient126.pbx extension
that you can import into your application library. You must first
connect to the Web service with an instance of the SoapConnection
class that is also defined in this extension.
For more information about connecting to a Web service, see “Building
a Web Services Client” in Application Techniques.
For cookie properties you can set or return with the SoapPBCookie
class, see the PowerBuilder Extension Reference.
Examples
The following example enters the names and values
of the cookies associated with a Web service in a MultiLineEdit
control:
1 |
wsproxy_service proxy |
1 |
soapPBCookie retu_cookies[] |
1 |
//create instance of a SoapConnection object |
1 |
//create instance of the Web service proxy |
1 |
endpoint = "http://sybase.com/webservice/Svc.asmx" |
1 |
retu_cookies = proxy.<span>pbgetcookies</span>(endpoint) |
1 |
mle_1.text = string(upperbound(retu_cookies))&<br>   +" total cookies" + "~r~n" |
1 |
for i= 1 to upperbound(retu_cookies) |
1 |
   mle_1.text += "Cookie"+ string(i)&       +"~r~n=====================~r~n" |
1 |
   mle_1.text +="getName = " &<br>      + retu_cookies[i].getname() +"~r~n" |
1 |
   mle_1.text +="getValue = " &<br>      + retu_cookies[i].getvalue()+"~r~n" |
1 |
next |