Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd February 2010, 04:17
moglia moglia is offline
Member
 
Join Date: Apr 2009
Posts: 92
Thanks: 7
Thanked 15 Times in 11 Posts
Exclamation Implementing SOAP example to create a website.

Hello i try implement a SOAP client to add some sites on batch rotine to ispconfig 3 need migrate many sites. Database script with soap works nice.

I try run and no need SSL fields if you complete the SSL fields run without any problem if you not do it you be recive this error:

Error: ssl_state_error_regex<br>
ssl_locality_error_regex<br>
ssl_organisation_error_regex<br>
ssl_organistaion_unit_error_regex<br>
ssl_country_error_regex<br>

Anyway completing all fields the website created not show on panel. It´s strange because i try run to create again with the same domain name and recive this error:

Error: domain_error_unique<br>


Code:
<?php

$username = '';
$password = '';

$soap_location = '';
$soap_uri = '';

$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri));

try {
    
    if($session_id = $client->login($username,$password)) {
        echo "Logged:".$session_id."<br />\n";
	}
  
	$domain_name = "superdomainxxx1.com";
	
	$params['server_id'] = 1;
	$params['ip_address'] = "";
	$params['domain'] = $domain_name;
	$params['type'] = 'Site'; //Site / Alias
	$params['parent_domain_id']="";
	$params['vhost_type'] = 'Namebased'; //Namebased / IP-Based
	$params['hd_quota'] = '100';
	$params['cgi'] = 'n'; //n // y
	$params['ssi'] = 'n';//n / y
	$params['suexec'] = 'n'; //n / y
	$params['errordocs'] = 1; //0 / 1
	$params['subdomain'] = 'www.'; //none / www. / *.
	$params['ssl'] = 'n'; //n / y
	$params['php'] = 'Mod-PHP'; //Disabled, Fast-CGI, CGI, Mod-PHP, SuPHP
	$params['active'] = 'y'; //n / y
	$params['redirect_type'] = 'No redirect'; //array('' => 'No redirect', 'no' => 'No flag', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L')
	$params['redirect_path'] = '';
    $params['ssl_action'] = 'None';
    
	/*$params['ssl_state'] = 'RJ';
	$params['ssl_locality'] = 'Locale';
	$params['ssl_organisation'] = 'Organization';
	$params['ssl_organisation_unit'] = 'Dpto Tecnologia';
	$params['ssl_country'] = 'BR';
	$params['ssl_domain'] = 'ispconfigtest.com';
	$params['ssl_request'] = '';
    $params['ssl_cert'] = '';
	$params['ssl_bundle'] = '';
    $params['ssl_action'] = 'None'; //array('' => 'None', 'save' => 'Save Certificate', 'create' => 'Create Certificate','del' => 'Delete Certificate')*/

	$client_id = 1;
	$website_id = $client->sites_web_domain_add($session_id, $client_id, $params);
	
	if($client->logout($session_id)) {
		echo "Logout.<br />\n";
	}
	
	
}
catch (SoapFault $e) {
	die('Error: '.$e->getMessage());
}

?>
Regards 4 any
antecipated help.
Reply With Quote
Sponsored Links
  #2  
Old 22nd February 2010, 10:41
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

check if you have a client with id 1. Login as admin user and check again if the site shows up, use the search function too.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 22nd February 2010, 12:43
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

Compare the record in the web_domain table of the non working website with a working website.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 22nd February 2010, 13:28
moglia moglia is offline
Member
 
Join Date: Apr 2009
Posts: 92
Thanks: 7
Thanked 15 Times in 11 Posts
Exclamation Is on database!

Code:
mysql> select domain,active from web_domain;
+----------------------------+--------+
| domain                     | active |
+----------------------------+--------+
| ispconfigtest.com          | y      |
| crazydomainxxx.com         | y      |
+----------------------------+--------+
5 rows in set (0.00 sec)
is on database, but don´t show on control panel. and directories don´t be created.

Last edited by moglia; 22nd February 2010 at 18:59.
Reply With Quote
  #5  
Old 22nd February 2010, 13:30
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

Please do what I recommended in #4. Compare the record of w working website with the record of a not working website.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 22nd February 2010, 14:02
moglia moglia is offline
Member
 
Join Date: Apr 2009
Posts: 92
Thanks: 7
Thanked 15 Times in 11 Posts
Exclamation One question.

Code:
'vhost_type' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'SELECT',
			'default'	=> 'y',
			'value'		=> array('name' => 'Namebased', 'ip' => 'IP-Based')
Some times 'value' use the value or aways use the key to record?
Reply With Quote
  #7  
Old 22nd February 2010, 14:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

This depends on the formtype.

- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)

= value

- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY

= array
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 22nd February 2010, 14:19
moglia moglia is offline
Member
 
Join Date: Apr 2009
Posts: 92
Thanks: 7
Thanked 15 Times in 11 Posts
Exclamation Question II

Code:
'active' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'CHECKBOX',
			'default'	=> 'y',
			'value'		=> array(0 => 'n',1 => 'y')
		),
I try to pass 0 or 1 because the field is from type CHECKBOX. i pass 1 and recorded active = N.
I pass Y and recorded active without any problems. this field don´t folow the work logic?

CHECKBOX from array correct?

Last edited by moglia; 22nd February 2010 at 16:10.
Reply With Quote
  #9  
Old 22nd February 2010, 16:14
moglia moglia is offline
Member
 
Join Date: Apr 2009
Posts: 92
Thanks: 7
Thanked 15 Times in 11 Posts
 
Exclamation About SSL Validations

Error: ssl_state_error_regex<br>
ssl_locality_error_regex<br>
ssl_organisation_error_regex<br>
ssl_organistaion_unit_error_regex<br>
ssl_country_error_regex<br>

if $params['ssl'] = 0; don´t make or check any validations about SSL it´s possible? because i try insert a domain without feel this fields i can not do it.

Possible fix need todo or another way to do it?
Reply With Quote
Reply

Bookmarks

Tags
soap

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't create website on remote server pixelmonkey Installation/Configuration 11 11th August 2009 10:05
Where do I create a website for a client? Doomster General 1 21st October 2008 07:30
Don't create stats folder when create a website quannv Server Operation 3 12th July 2008 11:36
Chroot SSH + ISPConfig Norman Installation/Configuration 27 26th March 2007 03:40
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36


All times are GMT +2. The time now is 00:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.