|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-05-04 09:16 UTC] michael dot caplan at henryschein dot com
Description: ------------ If possible, I think all magic methods (http://www.php.net/manual/en/language.oop5.magic.php) should be suppressed from generated service descriptions, as well as suppressed in the serive request handler (should a client try and call a magic method). For example, my service class implements a constructor, and this is being picked up by the WSDL generator. Actual result: -------------- <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns2="http://LabnetOnline001" xmlns:tns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://LabnetOnline001"> <types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://LabnetOnline001" elementFormDefault="qualified"> <xs:element name="__construct"> <xs:complexType> <xs:sequence> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="__constructResponse"> <xs:complexType> <xs:sequence> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="rot13"> <xs:complexType> <xs:sequence> <xs:element name="toencode" type="xs:string" nillable="true"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="rot13Response"> <xs:complexType> <xs:sequence> <xs:element name="rot13Return" type="xs:string" nillable="true"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> </types> <message name="__constructRequest"> <part name="__constructRequest" element="tns2:__construct"/> </message> <message name="__constructResponse"> <part name="return" element="tns2:__constructResponse"/> </message> <message name="rot13Request"> <part name="rot13Request" element="tns2:rot13"/> </message> <message name="rot13Response"> <part name="return" element="tns2:rot13Response"/> </message> <portType name="LabnetOnline001PortType"> <operation name="__construct"> <input message="tns2:__constructRequest"/> <output message="tns2:__constructResponse"/> </operation> <operation name="rot13"> <input message="tns2:rot13Request"/> <output message="tns2:rot13Response"/> </operation> </portType> <binding name="LabnetOnline001Binding" type="tns2:LabnetOnline001PortType"> <operation name="__construct"> <input> <tns3:body xsi:type="tns3:tBody" use="literal"/> </input> <output> <tns3:body xsi:type="tns3:tBody" use="literal"/> </output> <tns3:operation xsi:type="tns3:tOperation" soapAction=""/> </operation> <operation name="rot13"> <input> <tns3:body xsi:type="tns3:tBody" use="literal"/> </input> <output> <tns3:body xsi:type="tns3:tBody" use="literal"/> </output> <tns3:operation xsi:type="tns3:tOperation" soapAction=""/> </operation> <tns3:binding xsi:type="tns3:tBinding" transport="http://schemas.xmlsoap.org/soap/http" style="document"/> </binding> <service name="LabnetOnline001Service"> <port name="LabnetOnline001Port" binding="tns2:LabnetOnline001Binding"> <tns3:address xsi:type="tns3:tAddress" location="http://sandbox.int.labnet.net/michael/labnet_online/api/public_html/online001/index.php"/> </port> </service> </definitions> <!-- this line identifies this file as WSDL generated by SCA for PHP. Do not remove --> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 06:00:02 2025 UTC |
The following diff implements a simple check in SCA_Helper::filterMethods() for '__' in method names, skipping them over. Index: Z:/michael/labnet_online/api/lib/SCA/SCA_Helper.php =================================================================== --- Z:/michael/labnet_online/api/lib/SCA/SCA_Helper.php (revision 197) +++ Z:/michael/labnet_online/api/lib/SCA/SCA_Helper.php (working copy) @@ -233,6 +233,10 @@ /* Check every public method .... */ for ( $i = 0 ; $i < $elements ; $i++ ) { + if ((substr($public_list[ $i ], 0, 2) === '__')) { + continue; + } + /* ... has a reflection object .... */ foreach ( $allMethodsArray as $allMethod ) { $objArray = get_object_vars($allMethod);