barnonline
barnonline

Reputation: 327

Calling a webservice from .net core 2.0, help me understand the error message

I have some working .net 4.x code that is calling a webservice. I must move that code to .net core 2.0 and I'm experiencing some problems, and I don't even understand the error message.

            LoginInfo li = new LoginInfo();
            li.clientUserName = "username";
            li.clientPassword = "password";
            li.companyAccountNumber = "accountnumber";
            li.companyIdentifierType = 1;

            FKsoapPortTypeClient cl = new FKsoapPortTypeClient();
            getAllVehiclesInputs inputs = new getAllVehiclesInputs();

            inputs.clientUserName = li.clientUserName;
            inputs.clientPassword = li.clientPassword;
            inputs.companyAccountNumber = li.companyAccountNumber;
            inputs.companyIdentifierType = li.companyIdentifierType;

            getAllVehiclesResponse vd = await cl.getAllVehiclesAsync(inputs);

The operation 'getAllVehicles' could not be loaded because it specifies \"rpc-style\" in \"literal\" mode, but uses message contract types or the System.ServiceModel.Channels.Message. This combination is disallowed -- specify a different value for style or use parameters other than message contract types or System.ServiceModel.Channels.Message

Could someone point me in the right direction? It is hard to Google it if you don't even have an idea of what you are looking for.

Upvotes: 0

Views: 241

Answers (1)

Milen
Milen

Reputation: 674

Try updating the following packages to version 4.5.3, which seems to resolve the issue:

System.ServiceModel.Duplex

System.ServiceModel.Http

System.ServiceModel.NetTcp

System.ServiceModel.Security

Upvotes: 1

Related Questions