- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018
03:20 AM
02-12-2018
03:20 AM
Hola,
Necesito crear una categotía en magento 2.2 mediante SOAP
Estoy haciendo esto pero no estoy seguro que sea lo correcto porque no he logrado que categoría alguna se cree,
$request = new SoapClient("http://local.pruebas-magento/soap?wsdl&services=integrationAdminTokenServiceV1", array("soap_version" => SOAP_1_2)); $token = $request->integrationAdminTokenServiceV1CreateAdminAccessToken(array("username"=>"admin", "password"=>"xxxxxxx")); $opts = array( 'http'=>array( 'header' => 'Authorization: Bearer '.json_decode($token->result) ) ); $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);
Gracias
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018
09:28 AM
02-19-2018
09:28 AM
Hola @ggallego,
¿Cómo estás? (creo que te respondí en el thread en inglés).
¿No te sirve usar REST en lugar de SOAP?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018
09:28 AM
02-19-2018
09:28 AM
Hola @ggallego,
¿Cómo estás? (creo que te respondí en el thread en inglés).
¿No te sirve usar REST en lugar de SOAP?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018
09:34 AM
02-19-2018
09:34 AM
Re: Crear categoria con SOAP
Hola Damian,
Si, opté por realizarlo con REST, la verdad que estaba muy perdido para encontrar los servicios adecuados con SOAP y la documentación es escasa,
Gracias