Passing a full or partial shipment in the format implied by the documentation http://www.magentocommerce.com/api/soap/sales/salesOrderShipment/sales_order_shipment.create.html (hard coded IDs included for legibility):
$itemsQty = array(927 => '1',941 => '1');(for all combinations of quoting and/or hard-coding of the values of order_item_id and qty)
results in SOAP that ignores the actual data and fulfills the whole order.
Steps to reproduce:
Launch the script calling
$result = $proxy->call($session, 'sales_order_shipment.create', array('100000002', array(3 => 1, 4 => 1), 'Some comment', false, true));assuming 3 and 4 to be Product ID.
Resolution: items need to be passed as array (order_item_id => qty, order_item_id => qty, ...) where order_item_id is not the actual product item_id, but the id of the representing item for current order, in other words the same product created in Magento would have different order_item_id for every order the item has been purchased within. order_item_id (item_id) needs to be received for representing product_id from array $result by calling $result = $proxy->call($session, 'sales_order.info', '100000002');
[item_id] => 3 [order_id] => 2 [parent_item_id] => [quote_item_id] => 3 [store_id] => 1 [created_at] => 2012-02-06 22:02:41 [updated_at] => 2012-02-06 23:07:24 [product_id] => 2Correct call:
$result = $proxy->call($session, 'sales_order_shipment.create', array('100000002', array(3 => 1, 4 => 1), 'Some comment', false, true));where ' 3 ' is the order_item_id representing product item_id ' 2 ' , ' 4 ' is the order_item_id representing product item_id ' 1 ' in my test case scenario.