Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF service with PHP client - complex type as parameter not working
    text
    copied!<p>I have a WCF service with three methods. Two of the methods return custom types (these work as expected), and the third method takes a custom type as a parameter and returns a boolean. When calling the third method via a PHP soap client it returns an 'Object reference not set to an instance of an object' exception.</p> <p><strong>Example Custom Type:</strong></p> <p> _ Public Class MyClass</p> <pre><code>Private _propertyA As Double &lt;DataMember()&gt; _ Public Property PropertyA() As Double Get Return _propertyA End Get Set(ByVal value As Double) _propertyA = value End Set End Property Private _propertyB As Double &lt;DataMember()&gt; _ Public Property PropertyB() As Double Get Return _propertyB End Get Set(ByVal value As Double) _propertyB = value End Set End Property Private _propertyC As Date &lt;DataMember()&gt; _ Public Property PropertyC() As Date Get Return _propertyC End Get Set(ByVal value As Date) _propertyC = value End Set End Property </code></pre> <p>End Class</p> <p><strong>Method:</strong></p> <p>Public Function Add(ByVal param As MyClass) As Boolean Implements IService1.Add ' ... End Function</p> <p><strong>PHP client call:</strong></p> <p>$client->Add(array('param'=>array( 'PropertyA' => 1, 'PropertyB' => 2, 'PropertyC' => "2009-01-01" )));</p> <p>The WCF service works fine with a .Net client but I'm new to PHP and can't get this to work.</p> <p>Is it possible to create an instance of 'MyClass' in PHP.</p> <p>Any help would be appreciated.</p> <p>Note: I'm using PHP 5 (XAMPP 1.7.0 for Windows).</p> <p>Thanks</p> <p>Matt</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload