0

I am connecting to a java web service from my asp.net app ,but I am getting a 400 Bad request exception.

I have added a web reference in my project and using that to connect in the code as follows :

client is the web service reference object.

    NetworkCredential credentials = new NetworkCredential("", "");
        client.Credentials = credentials;

        client.PreAuthenticate = true;
        client.RequestEncoding = Encoding.UTF8;

        object response = client.getmethod(req);

I also tried putting in

        client.UnsafeAuthenticatedConnectionSharing = true;
        client.AllowAutoRedirect = true;

but it still does not work and gives me the same error. The request is working if i try from Soap-UI from my machine.

To Add, I am getting a ClientProtocol error in SoapUI also if i don't select authentication type as "PreEmptive". Is there a way to set this in asp.net.

Any thoughts would be appreciated.

user1701550
  • 23
  • 1
  • 6

0 Answers0