title: Set Magento Attribute to Configurable Product with Soap API
body: <p>I need to create a new configurable product via  Magento Soap API and add a related product to it.</p>
  
  <p>I use this code that create 2 products ( one simple and one configur. ) then i try to link the simple one to the config one...this don't work..
  There is a tutorial for do that??
  Any help??
  Many thanks.</p>
  
  <pre><code>// Magento login information 
      $mage_url = 'http://test.de/api/?wsdl'; 
      $mage_user = 'admin'; 
      $mage_api_key = 'admin'; 
      // Initialize the SOAP client 
      $soap = new SoapClient( $mage_url ); 
      // Login to Magento 
      $session = $soap-&gt;login( $mage_user, $mage_api_key );
  
  
  
      $attributeSets = $soap-&gt;call($session,'product_attribute_set.list');
      $set = current($attributeSets);
  
      $sku = 'iphone-12345';
  
      //configurable
  
      $newProductData = array(
          'name'              =&gt; 'iPhone',
          'websites'          =&gt; array(1),
          'short_description' =&gt; 'short description',
          'description'       =&gt; 'description',
          'price'             =&gt; 150,
          'status'            =&gt; '1',
          'categories'    =&gt; array(138),
      );
  
  
  
      $newProductRelated = array(
  
          'name'              =&gt; 'iPhone',
          'websites'          =&gt; array(1),
          'short_description' =&gt; 'short description',
          'description'       =&gt; 'description',
          'price'             =&gt; 150,
          'status'            =&gt; '1',
          'sku'               =&gt; '2551464'
              );
  
  
  
      $productId = $soap-&gt;call($session,'product.create',array('configurable', $set['set_id'], $sku ,$newProductData));
      $productId2 = $soap-&gt;call($session,'product.create',array('simple', $set['set_id'], $newProductRelated['sku'] ,$newProductRelated));
  
  
  
  
      $soap-&gt;call($session, 'product_link.assign', array('configurable', $sku, $newProductRelated['sku'], array('position'=&gt;0, 'colore'=&gt; 21, 'qty'=&gt;6)));
  </code></pre>
  
  <p>mant thx again.</p>