Customer creation
I assume you're using the standard customerCustomerCreate() SOAP v2 Method.
This method is referenced in app/code/core/Mage/Customer/etc/wsdl.xml
(grep for: "customerCustomerCreate").
The method create
is defined in Model/Customer/Api.php
where you can see that the customer/customer
Model is called:
class Mage_Customer_Model_Customer_Api extends Mage_Customer_Model_Api_Resource
{
....
/**
* Create new customer
*
* @param array $customerData
* @return int
*/
public function create($customerData)
{
$customerData = $this->_prepareData($customerData);
try {
$customer = Mage::getModel('customer/customer')
->setData($customerData)
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
return $customer->getId();
}
...
}
The Mage_Customer_Model_Customer_Api_V2
class extends Mage_Customer_Model_Customer_Api
.
So you'll need a bit of effort just to change it for the created customers via SOAP.
The password length is hardcoded in Mage_Customer_Model_Customer_Attribute_Backend_Password
(see: $len = Mage::helper('core/string')->strlen($password);
and if ($len < 6)
).
Unfortunately it isn't possible out of the box. You are right, filters are only used to filter attributes and there is no "limit" parameter
Arguments:
Type | Name | Description
string | sessionId | Session ID
array | filters | Array of filters by attributes (optional)
string | storeView | Store view ID or code (optional)
Source: http://www.magentocommerce.com/api/soap/catalog/catalogProduct/catalog_product.list.html
Looking at the source code of Mage_Catalog_Model_Product_Api
confirms it:
/**
* Retrieve list of products with basic info (id, sku, type, set, name)
*
* @param null|object|array $filters
* @param string|int $store
* @return array
*/
public function items($filters = null, $store = null)
{
$collection = Mage::getModel('catalog/product')->getCollection()
->addStoreFilter($this->_getStoreId($store))
->addAttributeToSelect('name');
/** @var $apiHelper Mage_Api_Helper_Data */
$apiHelper = Mage::helper('api');
$filters = $apiHelper->parseFilters($filters, $this->_filtersMap);
try {
foreach ($filters as $field => $value) {
$collection->addFieldToFilter($field, $value);
}
} catch (Mage_Core_Exception $e) {
$this->_fault('filters_invalid', $e->getMessage());
}
$result = array();
foreach ($collection as $product) {
$result[] = array(
'product_id' => $product->getId(),
'sku' => $product->getSku(),
'name' => $product->getName(),
'set' => $product->getAttributeSetId(),
'type' => $product->getTypeId(),
'category_ids' => $product->getCategoryIds(),
'website_ids' => $product->getWebsiteIds()
);
}
return $result;
}
The collection gets filtered by store and by attributes and that's it. No way to further manipulate it. What you'd need to do is write an own API model that extends this class and adds its own method itemsWithLimit()
with an additional parameter.
Update by request
if using the REST API with OAuth is an option, you actually can provide a limit:
Additional Information
You can define the limit of items returned in the response by passing
the limit parameter. By default, 10 items are returned and the maximum
number is 100 items. You can also define the page number by passing
the page parameter. Example:
http://magentohost/api/rest/products?page=2&limit=20
Authorization header will be required for Admin and Customer user
types. The following parameters must be provided in the Authorization
header for the call:
- oauth_consumer_key - the Consumer Key value provided after the registration of the application.
- oauth_nonce - a random value, uniquely generated by the application.
- oauth_signature_method - name of the signature method used to sign the request. Can have one of the following values: HMAC-SHA1,
RSA-SHA1, and PLAINTEXT.
- oauth_signature - a generated value (signature).
- oauth_timestamp - a positive integer, expressed in the number of seconds since January 1, 1970 00:00:00 GMT.
- oauth_token - the oauth_token value (Request Token).
- oauth_version - OAuth version.
Source: http://www.magentocommerce.com/api/rest/introduction.html#RESTAPIIntroduction-Products
Best Answer
Follow
steps
for the create new custom SOAP API methodStep : 1 Create file
app/etc/modules/AR_CustomApi.xml
Step : 2 Create file
app/code/local/AR/CustomApi/etc/config.xml
Step : 3 Create file
app/code/local/AR/CustomApi/Model/Product/Attribute/Set/Api.php
Step : 4 Create file
app/code/local/AR/CustomApi/etc/api.xml
Step : 5 Create file
app/code/local/AR/CustomApi/etc/wsdl.xml
Step : 6 Create file
app/code/local/AR/CustomApi/etc/wsi.xml
Step : 7
System -> Cache Management
and refresh all cacheSystem -> Web Services -> Roles
and save all roles againStep : 8 Called custom method like