PHP Classes

File: WsdlToPhpStructAttribute.php

Recommend this page to a friend!
  Classes of WsdlToPhp  >  WSDL To PHP  >  WsdlToPhpStructAttribute.php  
File: WsdlToPhpStructAttribute.php
Role: Class source
Content type: text/plain
Description: Class source
Class: WSDL To PHP
Generate classes to send SOAP requests from a WSDL
Author: By
Last change: [UPDATE] PSR-2 standards for generator files and generated files
[UPDATE] enhancements and refactoring


Simplification of the instantiation of Service objects in the
generated sample file by removing the SoapClient options parameter. By
default, the cache_wsdl is disabled, the wsdl_url is set with the WSDL
url used to generate the package and trace is set with true. The
VALUE_WSDL_URL constant has been added to the generated WsdlClass
defined with the WSDL url used to generate the package.

Remove trailing ?> in generator files/classes.

Add WsdlToPhpGenerator::getWsdl($_index) method to get any WSDL at any

Enhance generated sample file with explanation about the optional
parameter allowing to override the SoapClient Options. Remove the $wsdl
parareter previously used to instantiate each Service object.

Avoid Struct object to reset SoapClient when it is instantiated when
calling the parent constructor.
[UPDATE] several updates based on Github updated files
[UPDATE] code review and enhancements

Override WsdlToPhpModel::getOwner() method in inherited classes when it makes sense so the caller knows the exact return type

Enhanced attribute type definition by avoiding that the attribute type is the type of the class it belongs to
[UPDATE] minor generated setter improvement

When a struct contains properties with invalid names (such as "my-property"), the setter is named setMy_property but the property which is set is $this->{'my-property'} so when the object is sent to the SoapClient, this is the right value that is used. When we use var_export, then the property is exported as "my-property" but the __set_state() method, called in the WsdlClass when loading the exported object, only considers valid attribute names to call the setter. To fix this issue, we then also set the valid attribute name $this->my_property in the setMy_property() method, the setter. So the setter method, setMy_property() is called accordingly to the attribute name when the __set_state() method is called and everything goes well!
[UPDATE] global php doc harmonisation and minor improvement
[UPDATE] minor updates

Minor update to avoid PHP warning about empty XML content when calling the method on a DOMDocument property type

Php doc block comment update
Date: 7 years ago
Size: 13,153 bytes

You need to be a registered user and login to get this file.

1,590,492 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:

For more information send a message to info at phpclasses dot org.