title: Programming Magento with SOAP and c#
body: <p>I’m trying to program Magento from c#. 
  In the first step I added Service Reference to project in Visual Studio. But I don’t have MagentoService Class. I have it when I download wdsl file and convert it by wsdl.exe from Visual Studio Command Line. 
  So, in the case with service reference, my code looks like this: </p>
  
  <pre><code>MagentoSer.Mage_Api_Model_Server_HandlerPortTypeClient client = new MagentoSer.Mage_Api_Model_Server_HandlerPortTypeClient();
  var session= client.login("id", "password");
  client.call(session, "catalog_category.tree", null);
  client.endSession(session);
  </code></pre>
  
  <p>everything works all right. 
  But when I’m trying to use</p>
  
  <pre><code>MagentoSer.Mage_Api_Model_Server_HandlerPortTypeClient client = new MagentoSer.Mage_Api_Model_Server_HandlerPortTypeClient();
  var session= client.login("id", "password");
  client.call(session, "product_stock.list", "qqaz");
  client.endSession(session);
  </code></pre>
  
  <p>Exception occurs “Error in deserializing body of reply message for operation ‘call’” 
  The specified type was not recognized: name=’Map’, namespace=’<a href="http://xml.apache.org/xml-soap" rel="nofollow noreferrer">http://xml.apache.org/xml-soap</a>’, at ."} </p>
  
  <p>When testing from PHP everything works ok.
  I have found this two articles 
  <a href="http://codeblow.com/questions/php-web-service-in-c-invoke-function-returns-null/" rel="nofollow noreferrer">http://codeblow.com/questions/php-web-service-in-c-invoke-function-returns-null/</a> 
  <a href="https://stackoverflow.com/questions/733303/php-web-service-in-c-sharp-invoke-function-returns-null">PHP Web Service in C# : Invoke() function returns null</a> 
  but I can’t catch the big picture.</p>
  
  <p>Are those about object args in</p>
  
  <pre><code>public object call(string sessionId, string resourcePath, object args);
  </code></pre>
  
  <p>or about output from function?
  And one more thing. When searching the Web I have found example of code (Magneto help) where strange arrays are used (like complexFilter). How Can I get them if I connect to wsdl file via Visual Studio? Is this in Magento Administrator rights to expose them to me?</p>
  
  <p>Best Regards</p>
  
  <p>Przemysław Staniszewski</p>