cancel
Showing results for 
Search instead for 
Did you mean: 

Magento SOAP API V1 customer.list throws error as There is an error in XML document in C#.

Magento SOAP API V1 customer.list throws error as There is an error in XML document in C#.

Hi

I am developing one c# application to extract all customer data from mangento. For some reasong i need to use Magento SOAP API V1 instead of V2. I have used customer.list method to get all the customer list. But it throws error as below

 

Exception:

{"There is an error in XML document (2, 405)."}

 

InnerException:

{"The specified type was not recognized: name='Map', namespace='http://xml.apache.org/xml-soap', at ."}

 

Below is the code i used in c#:

MagentoService ma = new MagentoService();

ma.Url = "http://localhost:8080/magenew/index.php/api/soap";

string sessionid = ma.login("admin", "admin123");

object tmpobj = ma.call(sessionid, "customer.list", null);

 

I have tried providing empty string also for the third argument for the call function but nothing helps.

Any suggetion and solution highly appreciated.

 

Thanks and Regards

Venkatesan

4 REPLIES 4

Re: Magento SOAP API V1 customer.list throws error as There is an error in XML document in C#.

What is MagentoService ?

Dll ?

Re: Magento SOAP API V1 customer.list throws error as There is an error in XML document in C#.

MagentoService is Object for the WebService added.

 

Thanks and Regards

Venkatesan

Re: Magento SOAP API V1 customer.list throws error as There is an error in XML document in C#.

The same problem for me:

 

with C# web reference in solution pointing to soap api v1, while with soap v2 works..

here some sample code with v1:

 

....

MagentoV1.MagentoService mserviceV1 = new MagentoV1.MagentoService();
...
...
try
{
mlogin = mserviceV1.login(userM, pwd);
var store = mserviceV1.call(mlogin, "catalog_category_attribute.currentStore", null);
var res = mserviceV1.call(mlogin, "magento.info", null);
store = mserviceV1.call(mlogin, "catalog_product.currentStore", null);
//mserviceV1.callAsync(mlogin, "country.list", null);
// ok until now
// but the next
var countries = mserviceV1.call(mlogin, "country.list", null);
//throws exception;
}
catch (Exception ex)
{
return ex.ToString();
}

 

Re: Magento SOAP API V1 customer.list throws error as There is an error in XML document in C#.

I reverted to SOAP API v2 with no problems.

Then in order to retrieve the vat_id from customerAddressInfo this link helped me:

http://magento.stackexchange.com/questions/21852/get-order-address-vat-id-via-soap-api-v2-webservice

 

with the use of vat_id instead of taxvat.

 

Hope you solve too,

Cesare