Błąd deserializacji IAI API Visual Studio 2015

0

Witam,
Próbuję pobrać menu sklepu na platformie IAI za pomocą API. Niestety przy próbie pobrania menu pojawia się błąd:
"Additional information: Error in deserializing body of reply message for operation 'getMenu'."
Szukając odpowiedzi w google natrafiłem na informacje by powiekszyć parametry maxArrayLength i maxNameTableCharCount w pliku App.config. Niestety ustawienie ich nawet na maksymalną wartość nie naprawia błędu. Poniżej zamieszczam mój kod:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using LF_Menu_Language.ServiceReference1;

namespace LF_Menu_Language {
    class Program {
        static void Main(string[] args) {
            var binding = new BasicHttpBinding();
            var address = new EndpointAddress("http://domena.iai-shop.com/api/?gate=menu/getMenu/43/soap");
            var client = new ServiceReference1.ApiMenuPortTypeClient(binding, address);
            
            var request = new ServiceReference1.getMenuRequestType();
            request.authenticate = new ServiceReference1.authenticateType();
            request.authenticate.system_key = WebApiSystemKey.GenerateKey(WebApiSystemKey.HashPassword("password"));
            request.authenticate.system_login = "login";
            request.@params = new ServiceReference1.getMenuParamsType();
            [email protected]_id = 1;
            [email protected]_idSpecified = true;
            [email protected]_id = 1;
            [email protected]_idSpecified = true;
            [email protected]_id = "pol";
            [email protected]_id = 1;
            [email protected]_idSpecified = true;
            [email protected] = 1;
            [email protected] = true;
            request.settings = new settingsType();
            request.settings.textid_separator = "->";

            request.settings = new ServiceReference1.settingsType();

            ServiceReference1.getMenuResponseType response = client.getMenu(request);

            System.Console.WriteLine("Koniec");
        }

    }
}

Pytanie co zrobić by pozbyć się błędu?

0

A nie zwraca Ci może błędu w odpowiedzi xml? Mam również problem z deserializacją, lecz w metodzie getClientCRM. W odpowiedzi wysyła błędną wartość (zamiast yes_not_active to yes_no_active). Także wszelkie "max'y" w readersQuotas zostały powiększone, ale nie rozwiązało to kłopotu. Trochę to wygląda na błąd serwisu.

0

Tak szczerze to wchodząc w szczegóły błędu nie jestem w stanie nic z nich wywnioskować. W zasadzie wyświetlają się dwa Inner Exeptions. "InvalidOperationException: There is an error in XML document (2, 2794)." oraz "InvalidOperationException: Instance validation error: '' is not a valid value for actionType."

i coś takiego:

System.ServiceModel.CommunicationException occurred
  HResult=0x80131501
  Message=Error in deserializing body of reply message for operation 'getMenu'.
  Source=mscorlib
  StackTrace:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at ConsoleApp1.ServiceReference1.ApiMenuPortType.getMenu(getMenuRequestType getMenuRequest)
   at ConsoleApp1.ServiceReference1.ApiMenuPortTypeClient.getMenu(getMenuRequestType getMenuRequest) in C:\Users\...\source\repos\ConsoleApp1\ConsoleApp1\Connected Services\ServiceReference1\Reference.cs:line 1329
   at ConsoleApp1.Program.Main(String[] args) in C:\Users\...\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 36

Inner Exception 1:
InvalidOperationException: There is an error in XML document (2, 2794).

Inner Exception 2:
InvalidOperationException: Instance validation error: '' is not a valid value for actionType.

0

Możliwe, że faktycznie coś Ci źle zwraca. Jeżeli dobrze rozumiem to zamiast reload lub expand zwraca Ci nic. Warto przejrzeć logi i wiadomość jaką zwraca. W moim przypadku dało radę ominąć wadliwe dane poprzez ustalenie, które dokładnie elementy ma zwracać, ale w getMenu nie widzę takiej możliwości.

1 użytkowników online, w tym zalogowanych: 0, gości: 1