Magento: ошибка при создании продукта с помощью веб-сервиса - PullRequest
0 голосов
/ 05 октября 2018

Я хочу создать новый продукт в моем каталоге продуктов Magento.Получение сообщения об ошибке: указаны неверные данные.Подробности в сообщении об ошибке.Пожалуйста, помогите мне, как я могу узнать, какие данные являются недействительными, или где я могу получить подробное сообщение об ошибке.

Вот код:

string username = "xxxxxxxx";
        string apikey = "xxxxxxxxxxxxxxxxxxxxxx";

        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls |
                                   SecurityProtocolType.Tls11 |
                                   SecurityProtocolType.Tls12;

        PortTypeClient mservice = new PortTypeClient();
        String mlogin = mservice.login(username, apikey);


        string store_view = "1";
        string new_prod_sku = "TEST010";
        catalogProductCreateEntity new_prod_entity = new catalogProductCreateEntity();
        new_prod_entity.category_ids = new string[] { "2" };
        new_prod_entity.website_ids = new string[] { "0" };
        new_prod_entity.name = "Test 2";
        new_prod_entity.description = "Test 2";
        new_prod_entity.short_description = "Test 2";
        new_prod_entity.weight = "0";
        new_prod_entity.status = "1";
        new_prod_entity.url_key = new_prod_sku;
        new_prod_entity.url_path = new_prod_sku;
        new_prod_entity.visibility = "4";
        new_prod_entity.price = "200";
        new_prod_entity.tax_class_id = "1";
        new_prod_entity.stock_data = new catalogInventoryStockItemUpdateEntity()
        {
            qty = "10",
            is_in_stock = 1
        };

        int create = mservice.catalogProductCreate(mlogin, "simple", "0", new_prod_sku, new_prod_entity, store_view);
...