4
$productData = array(
 'sku' => 'MSD',
 'name' => 'MSD',
 'visibility' => 4, /*'catalog',*/
 'type_id' => 'simple',
 'price' => 5,
 'status' => 1,
 'attribute_set_id' => 4,
 'weight' => 1,
 'custom_attributes' => array(
 array( 'attribute_code' => 'category_ids', 'value' => ["3"] ),
 array( 'attribute_code' => 'description', 'value' => 'Simple Description' ),
 array( 'attribute_code' => 'short_description', 'value' => 'Simple Short Description' ),
 ),
 );

and passing data like below

$result = $soapClient->catalogProductRepositoryV1save(array('product' => $productData));

I got this error
Fatal error: Uncaught SoapFault exception: [env:Sender] Invalid product data: %1 in D:\xampp\htdocs\magento214\vendor\zendframework\zend-soap\src\Client.php:1116 Stack trace: #0 D:\xampp\htdocs\magento214\vendor\zendframework\zend-soap\src\Client.php(1116): SoapClient->__soapCall('catalogProductR...', Array, NULL, NULL, Array) #1 D:\xampp\htdocs\magento214\soap5.php(34): Zend\Soap\Client->__call('catalogProductR...', Array) #2 {main} thrown in D:\xampp\htdocs\magento214\vendor\zendframework\zend-soap\src\Client.php on line 1116

asked Mar 16, 2017 at 8:04
4
  • extension=php_soap.dll is Enabled? Commented Mar 16, 2017 at 8:12
  • @AnkitShah it is enabled .Passing the same data with REST it worked .Can you help me out.. Commented Mar 16, 2017 at 8:24
  • magento.stackexchange.com/questions/128223/… webkul.com/blog/magento-soap-api Commented Mar 16, 2017 at 8:27
  • thanks but it does not help as my access token and soap authorization both working fine,having error in product data @AnkitShah Commented Mar 16, 2017 at 9:33

1 Answer 1

3

Replace attribute_set_id with attributeSetId and type_id with typeId:

$productData = array(
 'sku' => 'MSD',
 'name' => 'MSD',
 'visibility' => 4, /*'catalog',*/
 'typeId' => 'simple',
 'price' => 5,
 'status' => 1,
 'attributeSetId' => 4,
...
answered Apr 7, 2017 at 1:57
1
  • How to send 'qty' => '30.0000' Please? Commented Feb 19, 2018 at 20:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.