I'm trying to post data to a .net web service and I receive the error : "SOAP-ERROR: Encoding: object has no 'ActiveCust' property".
Here is the wsdl:
<s:element name="SubmitNewCustomerToB1">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Context" type="tns:B1Context"/>
<s:element minOccurs="0" maxOccurs="1" name="WebsiteName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Cust" type="tns:Customer"/>
<s:element minOccurs="1" maxOccurs="1" name="ActiveCust" type="s:boolean"/>
<s:element minOccurs="0" maxOccurs="1" name="CustomerCustomAttrs" type="tns:ArrayOfCustomAttribute"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SubmitNewCustomerToB1Response">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SubmitNewCustomerToB1Result" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="B1Context">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="B1DBName" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="B1DefaultPriceListNumber" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="B1UKStandardVatCode" type="s:string"/>
</s:sequence>
</s:complexType>
<s:complexType name="Customer">
<s:complexContent mixed="false">
<s:extension base="tns:EntityObject">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CardCode" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="WebPassword" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="EmailAddress" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="FirstName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Surname" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Telephone" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="WebID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="VATNumber" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="FaxNumber" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Telephone2" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Organisation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="MobilePhone" type="s:string"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
<s:complexType name="CustomAttribute">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="FieldName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="FieldValue" type="s:string"/>
</s:sequence>
</s:complexType>
and here is my code:
error_reporting(E_ALL);
$Context =array(
"B1DBName" => "Test",
"B1DefaultPriceListNumber" => 1,
"B1UKStandardVatCode" => "O1",
);
$WebsiteName =array(
"WebsiteName"=> "Tes webiste"
);
$Cust =array(
"CardCode" => "",
"WebPassword" => "",
"EmailAddress" => "l@l.com",
"Title" => "Mr",
"FirstName" => "Luca",
"Surname" => "Luchino",
"Telephone" => "02094388",
"WebID" => "1988",
"VATNumber" => "",
"FaxNumber" => "0209998",
"Telephone2" => "",
"Organisation" => "",
"MobilePhone" => ""
);
$ActiveCust =array(
"ActiveCust" => true
);
$CustomerCustomAttrs=array(
$CustomAttribute=array(
"FieldName" => "",
"FieldValue" => ""
)
);
//Associative array
$params = array(
$Context,
$WebsiteName,
$Cust,
$ActiveCust,
$CustomerCustomAttrs
);
//var_dump($params);
try {
$client = new SoapClient("http://my.asmx?wsdl");
$result = $client->SubmitNewCustomerToB1($params);
var_dump($result);
}
catch (Exception $e)
{
echo "Error!<br />";
echo $e -> getMessage ();
}
The error I get: SOAP-ERROR: Encoding: object has no 'ActiveCust' property
Anyone can help me please ? Thank so much! Luca