我有一个WCF服务有三种方法。其中两个方法返回自定义类型(按预期工作),第三个方法将自定义类型作为参数并返回一个布尔值。当通过PHP soap客户端调用第三种方法时,它会返回一个'未设置为对象实例的对象引用'异常。WCF服务与PHP客户端 - 复杂类型作为参数不起作用
实施例自定义类型:
_ 公共MyClass类
Private _propertyA As Double
<DataMember()> _
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
<DataMember()> _
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
<DataMember()> _
Public Property PropertyC() As Date
Get
Return _propertyC
End Get
Set(ByVal value As Date)
_propertyC = value
End Set
End Property
末级
方法:
公共功能添加(BYVAL PARAM作为MyClass的)作为布尔值实现IService1.Add '... 结束函数
PHP客户端呼叫:
$客户机 - >添加(阵列(' PARAM'=>数组( 'PropertyA'=> 1, 'PropertyB'= > 2, 'PropertyC'=>“2009-01-01” )));
WCF服务对.Net客户端正常工作,但我是PHP新手,无法使其工作。
是否有可能在PHP中创建'MyClass'实例。
任何帮助,将不胜感激。
注意:我正在使用PHP 5(适用于Windows的XAMPP 1.7.0)。
感谢
马特
你试过$ myClassInstance = new $ Client-> MyClass(); – 2009-01-28 17:24:53