I am having a problem calling a web service request in C #.
The service and request work fine in the Soap user interface with the "Authenticate Preemptively" option enabled ("File", "Settings", "HTTP Settings"). Without this parameter, the service returns the message "Java.Lang.NullPointerException".
The problem I am facing is that I do not know how to enable this option in a C # context.
I have a .NET 3.5 class library that contains a so-called service link to a specific service. This is a simple piece of code,
try { CatalogService.CatalogChangeClient service = new CatalogService.CatalogChangeClient(); service.ClientCredentials.UserName.UserName = "fancydress"; service.ClientCredentials.UserName.Password = "47fda9cb4b51a9e"; service.ClientCredentials.SupportInteractive = true; ProductUpdate[] products = new ProductUpdate[1]; products[0] = new ProductUpdate(); products[0].ProductCode = "00001"; products[0].ProductDescription = "TestProduct"; string result = service.UpdateProducts(products); } catch (Exception exception) { Console.WriteLine(exception.Message); }
Update after the first answer.
The CatalogService.CatalogChangeClient class apparently implements the WCF abstract class
System.ServiceModel.ClientBase<TChannel>
Final update
Can someone help me set this property?
Rob maas
source share