1. Georgios Papageorgiou
  2. PowerBuilder
  3. Friday, 8 September 2017 16:38 PM UTC

Hi PowerSphere ,

How can I add Cookie information ( like session id etc ) when using the Datawindow Web Service object ?

TIA

Georgios

 

Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Friday, 8 September 2017 18:12 PM UTC
  2. PowerBuilder
  3. # 1

Hi Georgios,

 

You can use the PBAddCookie Function for that. You can refer to the PB help for more details. Here´s some info. Hope this helps.

 

PBAddCookie

Description

Adds a cookie to the Web service proxy object that will be sent to the server each time you call a Web service method.

Syntax

proxyObj.PBAddCookie ( acookie )

Argument

Description

proxyObj

The proxy object that you deploy from a Web Service Proxy project

acookie

An any containing information about the cookie you want to add

Return value

None.

Usage

If there is already a cookie with the same name and URI that you set in the acookie argument, you will replace the existing cookie when you invoke a Web service method. For the types of information you can include in the acookie argument, see the methods of the SoapPBCookie class in the PowerBuilder Extension Reference.

The SoapPBCookie class is defined in the pbwsclient170.pbx extension that you can import into your application library. It is valid for .NET Web services engine only.

Examples

The following example adds a cookie named myCookie that is sent to the server after you connect to a Web service from an objProxy proxy client:

SoapPBCookie acookie

acookie=create SoapPBCookie

 

acookie.SetUri("http://myServer/webservice/Svc1.wsdl")

acookie.SetName("myCookie")

acookie.SetValue("My Value")

objProxy.PBAddCookie(acookie)

 

Regards,

Govinda Lopez

 

Comment
  1. Georgios Papageorgiou
  2. Monday, 11 September 2017 08:17 AM UTC
Thanks , 



that works fine for the proxy object .... but



please tell me how i associate the PBCookie to the WS-connection object ?



( i.e dw.SetWSObject ( lwsconnection) )



Tia



Georgios

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.