I have a WCF service with three methods. Two custom types of methods come back (expected work), and The third method takes a custom type as a parameter and gives a boolean. When calling the third method through a PHP soap client, it gives the 'object reference not set for an example of an object' exception. Example
DataMember () & gt; _ Return to Public Property Asset A () Double_ Set Property A & Set (By-Val Value Double) _ Property A = Value and Set and Certified Private Pvt. Propytabi Double Like & lt; Datamember ()> _ Receive return twice as a public property property B () _Property B & End Set (by Value Value Double) _Property B = Value and Set End and Property Private _propertyC Date as & lt; DataMember () & gt;closing class
Method:
Add Public Function (ByVal param as MyClass) Boolean Implements as IService1.Add '... End Function
PHP Client Call:
$ client-> Add (array ('param' => array ('properties' => 1, 'property' => 2, 'properties' => "2009-01-01")));
The WCF service works fine with a net client, but I'm new to PHP and can not get it to work.
Is this
Any help would be appreciated.
Note: I am using PHP 5 (XAMPP 1.7.0 for Windows).
Thanks
test me There is no XAMPP setup for now but here are some example codes:
PHP:
$ wsdl = "https: //....../ServiceName. Svc? Wsdl "; $ Endpoint = "https: //...../ServiceName.svc/endpointName"; $ Client = new SOAP client ($ wsdl, array ('location' = & gt; $ endpoint)); $ Container = new study class (); $ Container- & gt; Request-> Property A = 'Test 1'; $ Container- & gt; Request-> PropertyB = 'Test 2'; $ Container- & gt; Request-> Properties = '05 / 10/2010 '; $ Response = $ client- & gt; Service ($ container);
The request is the name of the parameter expected by the web service.
If you have a custom type with reference to other custom types, then you can set those properties as follows:
$ Container-> Request-> Other custom type- & gt; Properties 1 = 'Test';
Hope that helps.
Comments
Post a Comment