0

I am sending a soap request to Magento and getting an error per below.

<?xml version="1.0" encoding="UTF-8"?>
-<soap:Envelope xmlns:def="XXX/soap/all? 
services=catalogProductAttributeOptionManagementV1" 
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  -<soap:Body>
  -<def:catalogProductAttributeOptionManagementV1AddRequest>
    <attributeCode>edition</attributeCode>
    -<option>
      <sort_order>0</sort_order>
      <is_default>false</is_default>
      <label>Test10</label>
      <value/>
    </option>
  </def:catalogProductAttributeOptionManagementV1AddRequest>
  </soap:Body>
</soap:Envelope>

Response is as per below:

<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:m="XXX%2Fsoap%2Fall%3Fservices%3DcatalogProductAttributeOptionManagementV1%26wsdl%3D1" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  -<env:Body>
  -<env:Fault>
  -<env:Code>
    <env:Value>env:Sender</env:Value>
  </env:Code>
  -<env:Reason>
    <env:Text xml:lang="en">Attribute %1 doesn't work with options</env:Text>
    </env:Reason>
  -<env:Detail>
-<m:GenericFault>
-<m:Parameters>
-<m:GenericFaultParameter>
  <m:key>1</m:key>
  <m:value>edition</m:value>
</m:GenericFaultParameter> 
</m:Parameters>
</m:GenericFault>
</env:Detail>
</env:Fault>
</env:Body>
</env:Envelope>

I have tried using catalogProductAttributeAddOption method, catalogProductAttributeOptionManagementV1AddPostBody method, catalogProductAttributeOptionManagementV1Add method. Please assist if a tag is missing or if I am using the wrong method?

T.I.A

0

I have been able to add the option to a text/visual swatch attribute by modifying my request xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:def="XXX/soap/all?services=catalogProductAttributeOptionManagementV1" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
  <def:catalogProductAttributeOptionManagementV1AddRequest>
    <attributeCode>test</attributeCode>
    <option>
      <sortOrder>0</sortOrder>
      <isDefault>false</isDefault>
      <label>Test123</label>
      <value/>
      <color>Blue</color>
   </option>
 </def:catalogProductAttributeOptionManagementV1AddRequest>
 </soap:Body>

OR

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:def="XXX/soap/all?services=catalogProductAttributeOptionManagementV1" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
  <def:catalogProductAttributeOptionManagementV1AddRequest>
    <attributeCode>test</attributeCode>
    <option>
      <sortOrder>0</sortOrder>
      <isDefault>false</isDefault>
      <label>Test123</label>
      <value/>
      <swatchvisual>
        <value>#e6db09</value>
      </swatchvisual>
   </option>
 </def:catalogProductAttributeOptionManagementV1AddRequest>
 </soap:Body>

The only issue I hav now is that the value(hex) is not updating the swatch: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.