login button

WSClient and response Headers

Forums :

Hello, I have code:
[code]
$security_options = array("useUsernameToken" => TRUE );
$policy = new WSPolicy(array("security" => $security_options));
$security_obj = new WSSecurityToken(array(
"user" => "user",
"password" => "user"));

$client = new WSClient(array(
"wsdl"=>"url to wsdl",
"useMTOM" => TRUE,
"policy" => $policy,
//'trace' => true,
"securityToken" => $security_obj,));

$proxy = $client->getProxy();

$result = $proxy->login(array("sid"=>'SID'));
print_r($result);

$res = $client->getLastResponse();
//$res = $client->getLastResponseHeaders();
print_r($res);
[/code]
Method login returns true and in headers some value. I want to get this value from headers.
getLastResponse() give me only what returns login() but no headers information.
I tried getLastResponseHeaders() with trace option (there is no information in api documentation about this functions) but it returns nothing.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Looks like you are using

Looks like you are using wsdl mode. if so is that wsdl defines this headers?. if so i think the problem can be that the headers are mixed up with security headers and php may failed to parse them correctly. (soap headers in wsdl mode were not supported in any of 1.3.* version, but it is supported in nightly builds http://wso2.org/downloads/wsf/php/nightly-build) If possible can you send us the wsdl, so we can test it here.

Thanks
Dimuthu

nightly-build - no mysql

Thx for reply.
I download nightly-build. I have linux so I must compile from source.
During ./configure i have error:
config.status: error: cannot find input file: src/storage/mysql/Makefile.in
configure: error: ./configure failed for sandesha2c
configure: error: ./configure failed for wsf_c

I check, and there is no src/storage/mysql/Makefile.in. There is only src/storage/sqlite/Makefile.in
So i tried:
./configure --without-mysql
./configure --with-mysql=no
But in both there is the same error :/

other problem

You write about SOAP headers.
But I'm talking about http headers. When I call WebService method, I received this response:
HTTP/1.1 200 OK
Date: Fri, 04 Jul 2008 08:05:12 GMT
Content-Length: 205
SOAPAction: ""
Set-Cookie: JSESSIONID=BC81C533C95D006B55D0018264A4A641; Path=/
Content-Type: text/xml;charset=UTF-8
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.0/Tomcat-6.0
Server: Apache-Coyote/1.1
...and here soap xml

There are http headers and soap message. I want to get http headers:
HTTP/1.1 200 OK
Date: Fri, 04 Jul 2008 08:05:12 GMT
Content-Length: 205
SOAPAction: ""
Set-Cookie: JSESSIONID=BC81C533C95D006B55D0018264A4A641; Path=/
Content-Type: text/xml;charset=UTF-8
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.0/Tomcat-6.0
Server: Apache-Coyote/1.1

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.