Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Cannot generate object of MagentoService in .NET
Jr. Member
Total Posts:  1
Joined:  2013-10-22


This is my first attempt to use Magento. I am trying to connect to my Magento Store using C#.NET. I am using .NET Framework 3.5.
Now the AddServiceReference is already added with below link.

I also set WS-I compatibility to “Yes” in System -> Configuration -> Magento Core API.

But when I refer the service in my page, I cannot generate the object of the service. I am looking for “Mage_Api_Model_Server_Wsi_HandlerPortType” object to connect.

Here is my code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyMagentoService;

namespace Magento_eBay_Console
class Program
static void Main(string[] args)

public static void Test()
MyMagentoService.  (When pressing . after MyMagentoService, I don’t get any object. I don’t know why.)

Update: When I set System -> Configuration -> Magento Core API -> WS-I compatibility to NO, I am able to get the object as below.

MagentoService.Mage_Api_Model_Server_V2_HandlerPortTypeClient ctx = new Mage_Api_Model_Server_V2_HandlerPortTypeClient();
ctx.login("Username", “Password");

But hte ctx.login throws an error :

The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 361 bytes of the response were: ‘<SOAP-ENV:Envelope xmlns:SOAP-ENV="">
<faultstring>SOAP extension is not loaded.</faultstring>

Image Attachments
Magento Community Magento Community
Magento Community
Magento Community
Total Posts:  54
Joined:  2009-12-26

Did you ever solve this?

We have had this running until we installed Varnish on our server, after that we cannot connect via SOAP from C# =/

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top