Hey everyone, I am trying to consume a WebService using PHP SoapClient
.
Now, everything is working fine until I try to use a ComplexType variable.
I am getting a NullPointerException
from the web service.
İşte bir örnek ComplexType değişkenin sınıftır:
class A {
public $var1 = 0; //int
public $var2; //Object: B
}
Şimdi, böyle bir nesneyi yapıyorum:
$a = new A();
$a->var2 = new B();
But, this has to be done every time I make an object of A.
Is there a method to initialize $var2
in class A
, without using the constructors for it, like we are doing for $var1
?