1

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);
Kobi
  • 2,494
  • 15
  • 30
Musa Alp
  • 11
  • 3
  • I also having the issue in wcf application .. when you add th eclient credentials through code and creating the header are you specifying the mustunderstand section in the security tag? – Antony Feb 26 '16 at 19:56
  • http://stackoverflow.com/questions/33895619/how-to-modify-tabs-for-the-secondary-menu-in-a-c-sharp-web-page-application/35658604#35658604 link to my question in stackoverflow. – Antony Feb 26 '16 at 19:57

0 Answers0