Search code examples
c#web-serviceswsdl

I can't add web reference from wsdl


I can't add the web reference from a wsdl file. I am getting an error. But it is working normally with SoapUI.

"RPC Message getFaturaResponse in operation getKurumSTFatura has an invalid body name getFaturaResponse. It must be getKurumSTFaturaResponse"

    abonePortTypeClient client = new abonePortTypeClient();

    if (client.State != CommunicationState.Faulted)
    {

        string outresult = string.Empty;
        var param35 = new AboneClient.SahaIsemri();
        param35.tesisatno = 1;
        param35.emirturu = 7;
        param35.altemirturu = 5;
        param35.elemankodu = 3208;


        string resultstring = null;
        var SahaIsemri = new AboneClient.SahaIsemri();

        client.ClientCredentials.UserName.UserName = "XXX";
        client.ClientCredentials.UserName.Password = "XXX";

        var aaa = client.putSahaIsemri(param35, out resultstring, out SahaIsemri);


    }

Solution

  • It refers that the references generated by wsdl does not match.

    getFaturaResponse in operation getKurumSTFatura has an invalid body name getFaturaResponse. It must be getKurumSTFaturaResponse
    

    You need to change the Operation in the service or you need to manually change in the reference.cs file.

    Search for the particular method and rename the response as above!