title: Magento - Add parameter to soap method
body: <p>I'm implementing a Magento client using SOAP, and I'm doing some changes to Magento in order to improve the overall performance of my application. For doing so, I'm trying to reduce the number of calls to Magento services.</p>
  
  <p>For example, I want to create new quote for shopping cart and set customer for it with one single call. To achieve this, I've changed <code>app\code\core\Mage\Checkout\etc\wsdl.xml</code>:</p>
  
  <pre><code>&lt;message name="shoppingCartCreateRequest"&gt;
      &lt;part name="sessionId" type="xsd:string"/&gt;
      &lt;part name="storeId" type="xsd:string"/&gt;
      &lt;part name="customer" type="typens:shoppingCartCustomerEntity"/&gt; &lt;!--added this line --&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>and in the file <code>/optiMage/app/code/core/Mage/Checkout/Model/Cart/Api.php</code>, I've changed the method create to this:</p>
  
  <pre><code>public function create($store = null, $customer = null)
  {
      $storeId = $this-&gt;_getStoreId($store);
  
      try {
          /*@var $quote Mage_Sales_Model_Quote*/
          $quote = Mage::getModel('sales/quote');
          $quote-&gt;setStoreId($storeId)
          -&gt;setIsActive(false)
          -&gt;setIsMultiShipping(false)
          -&gt;save();
      } catch (Mage_Core_Exception $e) {
          $this-&gt;_fault('create_quote_fault', $e-&gt;getMessage());
      }
      $quoteId = (int) $quote-&gt;getId();
  
      try{
          $service = new Mage_Checkout_Model_Cart_Customer_Api_V2();
          $res = $service-&gt;set($quoteId, $customer);
      } catch (Mage_Core_Exception $e) {
          $this-&gt;_fault('customer_not_set', $e-&gt;getMessage());
      }
  
      return $quoteId;
  }
  </code></pre>
  
  <p>The problem seems that the parameter I've added ($customer) is not accessible somehow. When I try to dump it, the server stop running and returns nothing to my app.</p>
  
  <p>Can you help me? Let me know if it's not clear enough. Thanks!</p>
  
  <p>PS: the $quoteId is still being generated. The problem arises when I try to interact with the newer variable.</p>
  
  <p><strong>============Edit============</strong>
  I found the problem: my client app was sending a different type of object and that's why Magento became unable to cast my parameter. Now it works! </p>
  
  <p>Thanks anyway :)</p>