wsdl2phpgenerator / wsdl2phpgenerator-cli

wsdl2phpgenerator command line application *work-in-progress*
MIT License
68 stars 22 forks source link

Generated Proxies have no __constructor implementation #7

Closed jschank closed 7 years ago

jschank commented 9 years ago

Hello, We used a really old version of wsdl2phpgenerator. And the generated output used to include a __constructor with properties passed in and being set inside the constructor.

For example:

  /**
   * 
   * @param string $Address1
   * @param string $Address2
   * @param string $City
   * @param string $Country
   * @param string $State
   * @param string $Zip
   * @access public
   */
  public function __construct($Address1, $Address2, $City, $Country, $State, $Zip)
  {
    $this->Address1 = $Address1;
    $this->Address2 = $Address2;
    $this->City = $City;
    $this->Country = $Country;
    $this->State = $State;
    $this->Zip = $Zip;
  }

The current version now generates an empty constructor.'

For example:

  /**
   * 
   * @access public
   */
  public function __construct()
  {

  }

The command we use is: call wsdl2php --cacheNone --singleElementArrays -i http://myserver/SampleService.svc?singleWsdl -o "D:\outputdir"

The output is different between versions (as described above), how can we get the constructor implementations to be generated with the new version of wsdl2php ?

kasperg commented 9 years ago

In newer versions of wsdl2phpgenerator the constructor only has parameters corresponding to the required (not nillable) properties for a type. You have to use accessors to set the values instead.