1

I'm trying to insert an image within the product register in my store using webservice xml soap V1 with the SoapUI program. Reference: http://www.magentocommerce.com/api/soap/catalog/catalogProductAttributeMedia/catalog_product_attribute_media.create.html My request:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">   
   <SOAP-ENV:Body>
      <ns1:call>
         <sessionId>fdda3f97e9f6d472d4d4d4d5807f54957d73</sessionId>
         <resourcePath>catalog_product_attribute_media.create</resourcePath>
         <args SOAP-ENC:arrayType="ns2:Map[2]" xsi:type="SOAP-ENC:array">
         <product xsi:type="xsd:string">38</product>
         <storeView xsi:type="xsd:int">1</storeView>
         <store_id xsi:type="xsd:int">1</store_id>
         <identifierType xsi:type="xsd:string">product</identifierType>
         <!-- starts first array -->
          <item xsi:type="ns2:Map">
            <item>
              <key xsi:type="xsd:string">content</key> 
              <value xsi:type="xsd:string">/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgBKgEqAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBB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UUlAHFfETx0fB+nwJbRJLqF1u8kPyqAYyxA69RxXg+r+I9R8Q3ouNVu5Lhx9xW4Rf91RwP516F8eNKuCdN1hEZoY0aCQj+Ek5FeJi5D5KEcdfUfWgl6lLVpy+ozqTkq5AOOo7VRDspyrEH2qa/cvLuYA/0qsGTHVh9RmkWlpYl+23C8LKwppvrk/8ALd/zqFtp6NmmHrRYXs4dkStcSv8AekY/jSBiTkkmhUj8osXw393H9ajzz3IoGklsa+j3DJdhQcLgk/XHFdBZ6xdaXfJe6fcva3KdJYjg49D6j2PFcrYuUJPtjFW/tG5wqEszHAVeeaBNH1N8L/HM/jDSJ479UGo2bBZWQYEinOGx2PBzXfV5V8FPCmo6Fo13qGpQGCS/2lImGGCDOCR268CvVKYC0UUUAFFFFABRRRQAUUUUAFFJS0AFFFFABSUtFABRRRQAUUUUAFFFFABRRRQAUUUUAJS0UUAV7uztr+0ltbuCOe3lUrJHIoZWHoQa8i8UfAHTL92uPD982nzcnyJgZIyfQHO5f1+ley0hoA+RtZ+EfjXS2bfo8l7Gv/LS0Ilz9APm/SuUufD2r2jFbrR9QgYdRJbOuPzFfcdLQFz4ONjcf8+0/wD3wf8ACm/YbrP/AB7Tf9+z/hX3nRQO58IxaZfzHbHY3MhJ6JExP8q3tP8Ah14u1Z/9E8N6gq4HzTRGNfzfAP4V9n0GgVz5u0L9nnW7wo+s6jb2EWeY4gZZCPTso/M/SvXPDHwp8K+FZ0urWyNxeIPluLpt7KfVR0B+grte9OoAQDFLSUtABRSUUALRRRQAUUUUAFFJS0AFFFFABRSUtABSUUUAf//Z</value>
            </item>
            <item>   
              <key xsi:type="xsd:string">mime</key> 
              <value xsi:type="xsd:string">image/jpeg</value>
            </item>      
            <item>   
              <key xsi:type="xsd:string">name</key> 
              <value xsi:type="xsd:string">imagemteste</value>
            </item>   
          </item> <!-- ends first array -->
          <!-- starts second array -->
            <item xsi:type="ns2:Map">
              <item>   
              <key xsi:type="xsd:string">label</key> 
              <value xsi:type="xsd:string">label01</value>
              </item>      
              <item>   
              <key xsi:type="xsd:string">position</key> 
              <value xsi:type="xsd:string">1</value>
              </item> 
              <item>   
              <key xsi:type="xsd:string">types</key> 
              <value xsi:type="xsd:ArrayOfString">thumbnail</value>
              </item>     
              <item>   
              <key xsi:type="xsd:string">exclude</key> 
              <value xsi:type="xsd:string">0</value>
              </item>   
              <!--<item>   
              <key xsi:type="xsd:string">remove</key> 
              <value xsi:type="xsd:string">0</value>
              </item>-->                              
            </item> <!-- end second array -->
         <!--<storeView xsi:type="xsd:string">default</storeView> -->
       </args>
      </ns1:call>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

My response (with error):

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>102</faultcode>
         <faultstring>A imagem não está especificada.</faultstring>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How solves this?

3

Your error is "The image is not specified" Your "file" key is missing in request check example. "content" and "mime" should be in key "file"

$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$productId = 2;
$file = array(
    'content' => '/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAXABcDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDLooor8XP4DCiiigAooooAKKKKAP/Z',
    'mime' => 'image/jpeg'
);

$result = $proxy->call(
    $session,
    'catalog_product_attribute_media.create',
    array(
        $productId,
        array('file'=>$file, 'label'=>'Label', 'position'=>'100', 'types'=>array('thumbnail'), 'exclude'=>0)
    )
); 

UPDATE
For XML Request try as below

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <ns1:call>
            <sessionId xsi:type="xsd:string">b219d4ec27c5c0c399ac0335ec2677cc</sessionId>
            <resourcePath xsi:type="xsd:string">catalog_product_attribute_media.create</resourcePath>
            <args SOAP-ENC:arrayType="xsd:ur-type[2]" xsi:type="SOAP-ENC:Array">
                <item xsi:type="xsd:int">38</item>
                <item xsi:type="ns2:Map">
                    <item>
                        <key xsi:type="xsd:string">file</key>
                        <value xsi:type="ns2:Map">
                            <item>
                                <key xsi:type="xsd:string">content</key>
                                <value xsi:type="xsd:string">/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAXABcDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDLooor8XP4DCiiigAooooAKKKKAP/Z</value>
                            </item>
                            <item>
                                <key xsi:type="xsd:string">mime</key>
                                <value xsi:type="xsd:string">image/jpeg</value>
                            </item>
                        </value>
                    </item>
                    <item>
                        <key xsi:type="xsd:string">label</key>
                        <value xsi:type="xsd:string">Label</value>
                    </item>
                    <item>
                        <key xsi:type="xsd:string">position</key>
                        <value xsi:type="xsd:string">100</value>
                    </item>
                    <item>
                        <key xsi:type="xsd:string">types</key>
                        <value SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array">
                            <item xsi:type="xsd:string">thumbnail</item>
                        </value>
                    </item>
                    <item>
                        <key xsi:type="xsd:string">exclude</key>
                        <value xsi:type="xsd:int">0</value>
                    </item>
                </item>
            </args>
        </ns1:call>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
  • thanks for comment, but how can i do this in xml? – Matheus Silva Itep Oct 19 '15 at 5:23
  • @MatheusSilvaItep updated my answer – Minesh Patel Oct 19 '15 at 6:41
  • thanks man (your xml is correctly), now its works :-), i will see whats different in my code , thanks again – Matheus Silva Itep Oct 19 '15 at 7:19
  • @MatheusSilvaItep you can up vote as well :) – Minesh Patel Oct 19 '15 at 7:31

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.