Click here to Skip to main content
15,889,879 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am consuming SOAP web service from my .net application. I have executed the .wsdl file given to me and it is showing the definition content. I have following code that is not giving required response.

static void Main(string[] args)
        {
            TestService();
            Console.ReadLine();
        }

        private static async void TestService()
        {
            try
            {
                ServiceReference1.SolutionsClient client = new ServiceReference1.SolutionsClient();
                client.ClientCredentials.UserName.UserName = "username";
                client.ClientCredentials.UserName.Password = "password12345";

                var result = await client.SolutionAvailabilityAsync("", "", "", "", "", "2019-05-15", "2019-05-16", "", "", "2", "1");

                string value = "a";
            }
            catch (Exception ex)
            {

            }
        }



In result, I am getting <Error>Invalid Credentials or Invalid Request Format</Error> as @return. It expects every parameter in string. What is the cause of this error???

What I have tried:

Tried changing the date time format but it did not help.
Posted
Comments
Richard Deeming 5-Mar-19 16:20pm    
The cause of the error is obvious: either the credentials you have provided are invalid, or the request format is invalid.

You'll need to talk to the people who wrote the service to find out why it's not working.
[no name] 6-Mar-19 0:15am    
Seriously, you have a ".UserName" called "username"?

Same goes for your "password".
Codes DeCodes 6-Mar-19 3:24am    
No, this is just a example. I have different username and password.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900