I am using a webservice on vs2013 which needs a UserNameToken.
When I am trying the request on soapui everything is fine.
soapui request is this,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.kds.kkb.com.tr/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>XXXX</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">YYYY</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ws:bakiyeSorgula>
<BakiyePaketSorgulaInputBean>
<kanal>5</kanal>
<kullaniciAdSoyad></kullaniciAdSoyad>
<kullaniciTckn></kullaniciTckn>
<subeBayiAdi></subeBayiAdi>
<subeBayiKodu></subeBayiKodu>
</BakiyePaketSorgulaInputBean>
</ws:bakiyeSorgula>
</soapenv:Body>
</soapenv:Envelope>
When I try to request on codebehind, something goes wrong.
Getting these error messages.
"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."
"MustUnderstand headers:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood"
My code clock is this,
var client = new BasvuruIslemleriClient();
client.ClientCredentials.UserName.UserName = "XXXX";
client.ClientCredentials.UserName.Password = "YYYY";
var bakiye = new bakiyePaketSorgulaInputBean()
{
kullaniciAdSoyad = "",
kanal = "5",
kullaniciTckn = "",
subeBayiAdi = "",
subeBayiKodu = "",
};
var result = client.bakiyeSorgula(bakiye);