I am trying to call a SOAP webservice, however I am getting the error: Additional information: The username is not provided. Specify username in ClientCredentials.
So I thought I could just set client.ClientCredentials to a new instance of NetworkCredentials. However ClientCredentials is read only. So how can I go about passing this information on to access the web service?
myService.ServiceClient client = new myService.ServiceClient();
// This won't work since its read only.
client.ClientCredentials = new System.Net.NetworkCredential("username", "password", "domain");
string version = client.getData();
EDIT: Binding:
<binding name="VersionHttpBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
</security>
</binding>