php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66508 The function executes error
Submitted: 2014-01-17 16:33 UTC Modified: 2014-01-19 14:54 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lyroe_chan at hotmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.5.8 OS: ubuntu 13.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lyroe_chan at hotmail dot com
New email:
PHP Version: OS:

 

 [2014-01-17 16:33 UTC] lyroe_chan at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/class.soapheader
---
The SoapClient::SoapHeader() doesn't work as it declares in php.net document.

Test script:
---------------
$wsdl = 'http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl';
$client = new SoapClient($wsdl, array('trace' => true));

$var = array(
		'LoginName' => 'xxxx',
		'Password'  => 'yyyy',
		);
$ns = 'http://schemas.tourico.com/webservices/authentication';
$soapheadervar = new SoapVar($var, SOAP_ENC_OBJECT, null, null, null);
$soapheader = new SoapHeader($ns, 'AuthenticationHeader', $soapheadervar);

$client->__setSoapHeaders($soapheader);
$body = array(...);
$response = $client->SomeFunction($body);
echo "Request:\n".$client->__getLastRequest()."\n";
echo "Response:","\n",$client->__getLastResponse(),"\n";

Expected result:
----------------
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tourico.com/webservices/hotelv3">
  <SOAP-ENV:Header>
    <m:AuthenticationHeader xmlns:m='http://schemas.tourico.com/webservices/authentication'>
      <m:LoginName>xxxx</m:LoginName>
      <m:Password>yyyy</m:Password>
    </m:AuthenticationHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    ........
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Actual result:
--------------
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tourico.com/webservices/hotelv3" xmlns:ns2="http://schemas.tourico.com/webservices/authentication">
  <SOAP-ENV:Header>
    <m:AuthenticationHeader>
      <m:LoginName>xxxx</m:LoginName>
      <m:Password>yyyy</m:Password>
    </m:AuthenticationHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    ........
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-19 14:54 UTC] felipe@php.net
-Summary: The functioin executes error +Summary: The function executes error
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC