0

We are accessing a java webservice in .net application which works well in soap UI after setting preemptive authorization type.But through c# code when we access the WSDL we are getting some errors.It seems we have to set preemptive authorization type in webconfig or c# code.How to do that?

Nicholas K
  • 15,148
  • 7
  • 31
  • 57
peter
  • 8,158
  • 21
  • 66
  • 119
  • Do you mean to add credentials to access the service? When invoking a service using a channel factory, you can add username/password based on authentication. ChannelFactory factory = new ChannelFactory(new BasicHttpBinding(), new EndpointAddress("http://172.17.16.82")); factory.Credentials.UserName.UserName = "administrator"; factory.Credentials.UserName.Password = "123456"; – Abraham Qian Dec 17 '18 at 07:45
  • You may want to take a look at this answer: https://stackoverflow.com/a/26437984/2016162 – Popo Dec 17 '18 at 17:25
  • https://stackoverflow.com/questions/53838399/error-while-accessing-java-webserivice-in-net .This is infact the question – peter Dec 18 '18 at 17:42

0 Answers0