Here I have tried but I getting this error:
Fatal error: Uncaught SoapFault exception: [env:Sender] %fieldName is a required field.
require('vendor/zendframework/zend-server/src/Client.php');
require('vendor/zendframework/zend-soap/src/Client.php');
require('vendor/zendframework/zend-soap/src/Client/Common.php');
$token = '6ge34qaj7ugklona2in8fmmig93qmblx';
$wsdlUrl = 'http://localhost/magento214/soap/default?wsdl&services=catalogProductRepositoryV1';
$opts = ['http'=> ['header' => "Authorization: Bearer " .$token]];
$context = stream_context_create($opts);
$soapClient = new \Zend\Soap\Client($wsdlUrl);
$soapClient->setSoapVersion(SOAP_1_2);
$soapClient->setStreamContext($context);
$productData = array(
'sku' => 'ZZ-TEST',
'name' => 'testproduct',
'visibility' => 4, /*'catalog',*/
'type_id' => 'simple',
'price' => 45,
'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' ),
)
);
$productData = json_encode(array('product' => $productData));
// print_r($productData);exit;
$result = $soapClient->catalogProductRepositoryV1save($productData);
var_dump($result);