How to read soap response header

21
April 16, 2019, at 11:30 AM

Getting response from one of the soap function php, after that sending this response as a parameter to another soap request, that time I need to extract the set-cookie from the previous response header here below my response header. I need to read set-cookie JSESSIONID element ?

HTTP/1.1 200 OK
Set-Cookie: **JSESSIONID=9A977E193F9B505B084D95C3028BAD0C.srv1816**;
Path=/webservices
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Apr 2019 07:38:52 GMT
Set-Cookie: aeroID=12988141315553139361555313936504655;Path=/;
Expires=Sun, 09-Feb-2020 07:38:56 GMT
Answer 1

You could just read your JSESSIONID cookie like so :

First get your cookies :

import com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport
def cookieStore= HttpClientSupport.getHttpClient().getCookieStore()

Then just find the one that interest you

def cookies = cookieStore.getCookies()
def jsessionidCookie
cookies.each {
    if(it.name == "JSESSIONID")
        jsessionidCookie= it
}
READ ALSO
PHP debug recursion

PHP debug recursion

I have a problem when I want to add debugging for recursion to send me the backtrace to show in which file an error occured (I'm not able to debug because the code is on another server)

19
What is the PDO equivalent of function mysql_real_escape_string?

What is the PDO equivalent of function mysql_real_escape_string?

I am modifying my code from using mysql_* to PDOIn my code I had mysql_real_escape_string()

43
How to detect emoji in plain text with PHP Preg_Match? REGULAR [E-XX]

How to detect emoji in plain text with PHP Preg_Match? REGULAR [E-XX]

I want to change the expressions in the form [E-01] - [E-02] - [E-03] - [E-04]

23
Create/Delete Space seperated folder names

Create/Delete Space seperated folder names

When I try to create a folder whose name is seperated by spaces it only takes the first word and ignores the second oneHow do I solve this? I am writing with php to a dovecot sever

25