Active
Project:
SOAP Server
Version:
7.x-3.0-alpha2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Oct 2011 at 09:39 UTC
Updated:
14 Oct 2011 at 12:45 UTC
Hi,
I have some problem with SOAP user creation function.
When I look the WSDL i can see this:
<message name='user_soap_create_request'>
<part name='account' type='xsd:array' />
</message>
<message name='user_soap_register_request'>
<part name='account' type='xsd:array' />
</message>
So I try to call "user_soap_create_request" and feed it with an array.
My code is somethink like this:
ini_set("soap.wsdl_cache_enabled", "0");
$wsdl = 'http://localhost/services/soap/registration?wsdl';
$endpoint = 'http://localhost/services/soap/registration';
$response = null;
$soapClient = new SoapClient($wsdl, array('trace' => true, 'exceptions' => true, 'cache_wsdl' => false));
$soapClient->__setSoapHeaders();
$user = array(
'name' => 'newuser',
'mail' => 'newuser@email.com',
'pass' => '0123456789',
);
$functions = $soapClient->__getFunctions();
try{
$response[] = $soapClient->__soapCall('user_soap_register', $user );
} catch(SoapFault $e){
print_r($e);
}
print_r($response);
But the service resonde me:
Service unavailable (with message)
or somethink like this when i try to use an array in a array:
Cannot use object of type stdClass as array
Some one can help me?
Thanks and sorry for my bad english.
Comments
Comment #1
marcus_clements commentedI just read your message properly!! I'll try and repeat your error later and comment.
Ignore the stuff below...
Web services run as anonymous user.
If you want your service to be able to create users you must set the Register Without Approval setting.
From services/resources/user_resource.inc line 436 : _user_resource_access()
Alternatively you could create your own resource based on the services user resource and define your own access conditions.