php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38309 SoapServer doesn't seem capable of processing SOAP Headers
Submitted: 2006-08-03 09:53 UTC Modified: 2007-02-24 21:53 UTC
Votes:6
Avg. Score:4.2 ± 0.9
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:0 (0.0%)
From: hummel at channeladvisor dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.1.4 OS: Windows
Private report: No CVE-ID: None
 [2006-08-03 09:53 UTC] hummel at channeladvisor dot de
Description:
------------
The SoapServer class doesn't seem to support processing SOAP Headers.

An example SOAP request to the server looks as this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<SOAP-ENV:Header>
		<m:RequesterCredentials xmlns:m="http://localhost/3.0.2/soap/">
			<username>String</username>
			<password>String</password>
			<signature>String</signature>
		</m:RequesterCredentials>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body>
		<m:GetAvailableStockQuantityRequest xmlns:m="http://localhost/3.0.2/soap/">
			<itemID>-0</itemID>
		</m:GetAvailableStockQuantityRequest>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


As you can see, the header "RequesterCredentials" is sent to the server. I need to process and validate "RequesterCredentials" on the server side, but the class SoapServer doesn't seem to support of processing headers (i.e. I cannot implement header checks if I wanted to using SoapServer).

If a developer can use SoapServer to process headers, it is a documentation issue. 

If a developer cannot use SoapServer to process headers, it should made clear within the documentation.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-03 09:56 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-08-03 10:04 UTC] hummel at channeladvisor dot de
Hello Tony,

is there a (pre-)documentation for 5.2 available?
 [2006-08-03 10:18 UTC] tony2001@php.net
All docs are available @ php.net.
There shouldn't be any differencies in SOAP except for bugfixes.
 [2006-08-03 12:06 UTC] hummel at channeladvisor dot de
I guess my request was not clear.

A developer can register SOAP functions via calling

$server = new SoapServer("<somewsdl>");
$server->addFunction("<functionname>");

but there seems no method to do

$server->addHeaderFunction("<headerfunctionname>");

Given my example above, I want to process the header "RequesterCredentials", so I would have to do something like

$server->addHeaderFunction("RequesterCredentials");

It is not documented wether header processing is possible using SoapServer or not.
 [2006-08-03 12:22 UTC] tony2001@php.net
If it's not documented - it is not possible.
Please express your thoughts more clearly next time.
Thank you.
 [2006-08-03 12:34 UTC] hummel at channeladvisor dot de
Dear Tony,

after reading my initial request, it is certainly clear what my request was. 

However, it should be documented that processing SoapHeaders within a SoapServer is not possible.
 [2006-08-03 13:00 UTC] tony2001@php.net
Please explain - what exactly should be documented?
The fact that there is no such function?
 [2006-08-03 13:13 UTC] hummel at channeladvisor dot de
On the documentation page

http://de2.php.net/manual/en/function.soap-soapserver-addfunction.php

add the following note below the existing note:

Note: You cannot process SOAP headers using addFunction. The only way to process SOAP headers is to extract them via $HTTP_RAW_POST_DATA and process them before calling SoapServer->handle().
 [2007-02-24 21:53 UTC] dmytton@php.net
Processing headers is nothing to do with addFunction(). This isn't really a documentation issue because there is no function to process headers. I'm going to close this as a documentation issue. If you want to request it as a feature, reopen as a feature request.
 [2010-07-25 00:53 UTC] ruben at messwithyou dot com
Please reopen this as a feature request, 

Being able to process the send headers would be a lot better for sending meta data 
along which I need!
 [2013-11-18 22:03 UTC] markfb at vorensys dot com
The fact that you can't process soap headers via addFunction() seems like a glaring omission to me. I've just wasted a lot of time figuring this out and I agree that it should be handled either via a feature request or by clearly stating this limitation in the documentation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC