I am using network authentication but getting an Authentication error. need to send username and password in the SOAP Header
//------------------------------------------------------------------
//STEP 2: CREATE CREDENTIALS OBJECT CONTAINING USERNAME AND PASSWORD
//------------------------------------------------------------------
NetworkCredentialPPCcredentials =
newNetworkCredential(txtUserName.ToString(),
txtPassword.ToString());
Uriuri =
newUri(webService.Url);
CredentialCachecredentials =
newCredentialCache();
credentials.Add(uri,"Basic",
PPCcredentials);
request need to have the following header:
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&q
uot; xmlns:wsu="http://docs.
oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-8D2E5C87643638F61D14968505181211">
<wsse:Username>userxxx</wsse:Username> <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-
1.0#PasswordText">pwdxxxxx</wsse:Password> <wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-secur
ity-1.0#Base64Binary">h1J+B/PCqCvQmcc+mtt+iA==</wsse:Nonce>
<wsu:Created>2017-06-07T15:48:38.115Z</wsu:Created> </wsse:UsernameToken>
</wsse:Security>
</soapenv:Header