Hello All!
I try to create user in WebSitePanel, through PHP.
When i try to getuser - everything work ok. When i try to AddUser i get error:
"Server was unable to process request. ---> Object reference not set to an instance of an object."
My PHP code is:
<?php
require_once ("../api/lib/nusoap.php");
$dnp = new soapclient('http://192.168.3.235:9002/esUsers.asmx?WSDL', true);
$dnp->soap_defencoding = 'utf-8';
/* Set credentials - this is DotNetPanel login */
$dnp->setCredentials("serveradmin", "sa1234568");
$param=array("ownerId"=>1,"RoleId"=>3,"StatusId" =>1,"IsDemo"=>"false","IsPeer"=>"false","Username"=>"yun","Password"=>"123123");
$result = $dnp->call('AddUser', array('parameters' => $param),
'http://officepark/dotnetpanel/enterpriseserver',
'http://officepark/dotnetpanel/enterpriseserver/AddUser');
print_r($result);
but result is
"Server was unable to process request. ---> Object reference not set to an instance of an object."
Request
POST /esUsers.asmx HTTP/1.0
Host: 192.168.3.235:9002
User-Agent: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://smbsaas/websitepanel/enterpriseserver/AddUser"
Authorization: Basic c2VydmVyYWRtaW46c2ExMjM0NTY4
Content-Length: 459
<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns9055="http://officepark/dotnetpanel/enterpriseserver"><SOAP-ENV:Body><AddUser xmlns="http://smbsaas/websitepanel/enterpriseserver"></AddUser></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Thu, 16 Sep 2010 06:45:56 GMT
Connection: close
Content-Length: 840
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><soap:Header><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:45614997-fa2c-4e9a-87c4-9a37e094b890</wsa:MessageID><wsa:RelatesTo>urn:uuid:4ae22147-4291-4ca9-934c-742aca67ebbe</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server
was unable to process request. ---> Object reference not set to an instance of an object.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>
i hope official support example for AddUser dotnetpanel of api
?>