0

I am trying to add a product on Magento ver. 1.9.2.4. using SOAP API:

https://www.domainname.com/index.php/api/v2_soap/

using the following XML:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <catalogProductCreate xmlns="urn:Magento">
        <sessionId xsi:type="xsd:string">sessioidhere</sessionId>
        <type xsi:type="xsd:string">simple</type>
        <set xsi:type="xsd:int">4</set>
        <sku xsi:type="xsd:string">skuhere</sku>
        <productData xsi:type="ns1:catalogProductCreateEntity" xmlns:ns1="urn:Magento">
            <name xsi:type="xsd:string">productnamehere</name>
            <price xsi:type="xsd:decimal">2.6</price>
            <status xsi:type="xsd:int">1</status>
            <visibility xsi:type="xsd:int">4</visibility>
            <weight xsi:type="xsd:decimal">0.2</weight>
            <tax_class_id xsi:type="xsd:int">0</tax_class_id>
            <websites>
                <item xsi:type="xsd:int">1</item>
            </websites>

            <short_description xsi:type="xsd:string">shortDescriptionHere</short_description>
            <description xsi:type="xsd:string"><![CDATA[DescriptionHereInHTMLTAGS]]></description>
            <meta_title xsi:type="xsd:string">metaTitleHere</meta_title>
            <meta_description xsi:type="xsd:string">metaDescriptionHere</meta_description>
      </productData>
      <store xsi:type="xsd:string">0</store>
    </catalogProductCreate>
  </soap:Body>
</soap:Envelope>

I am replacing the dummy values above with the actual values.

Now the issue is, the product gets created rarely and most of the time like 99% of the time I get the following error:

500 Internal Server Error: ModSecurity: XML parser error: XML: Failed parsing document.

I have been searching for like 2 days but I can't seem to figure out what the problem is. I am no expert in XML or even on Magento and the reason I am using the XML is that I am calling the API from a make.com automation scenario.

Can someone please point out what might be going on or if there are issues in the XML file?

Thank you.

0

Your Answer

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.