cancel
Showing results for 
Search instead for 
Did you mean: 

I can not create a category using SOAP in magento 2.2

I can not create a category using SOAP in magento 2.2

Hello!

I am trying to use SOAP to create a category in version 2.2 of magento, in the documentation there is not much but I have found that unlike previous versions now the available SOAP methods are not all together but they are divided by services which I can list with a url how is this

http://127.0.0.1/soap/all?wsdl_list=1

Then I should look in that list the url of the service and make the calls depending on the service I want to use, for example:

http://127.0.0.1/soap/all?wsdl&services=storeStoreRepositoryV1

My problem is that I have gone through all the services that could allow creating a category and apparently there is none or I have not found it,

Does anyone know what service allows me to create a category?

 

$wsdlUrl = 'http://local.pruebas-magento/soap/all?wsdl&services=catalogCategoryRepositoryV1';
$context = stream_context_create($opts);
$soapClient = new SoapClient($wsdlUrl, ['version' => SOAP_1_2, 'context' => $context]);
// $soapResponse = $soapClient->__getFunctions();

// Params
$objCat->category = new \stdClass;
$objCat->categoryId = NULL;
$objCat->category->name = "SOAP Cat";
$objCat->category->isActive = true;

// Call
$soapResponse = $soapClient->catalogCategoryRepositoryV1Get($objCat);


Thank you

1 REPLY 1

Re: I can not create a category using SOAP in magento 2.2

Hi @ggallego,


Is it possible for you to use REST instead of SOAP?

Here you'll find an example for category creation: http://devdocs.magento.com/swagger/#!/catalogCategoryRepositoryV1/catalogCategoryRepositoryV1SavePos...