How can I pass a username/password in the header to a SOAP WCF Service

后端 未结 9 1776
长发绾君心
长发绾君心 2020-11-27 13:03

I\'m trying to consume a third-party web service https://staging.identitymanagement.lexisnexis.com/identity-proofing/services/identityProofingServiceWS/v2?wsdl

I alr

9条回答
  •  被撕碎了的回忆
    2020-11-27 13:31

    I added customBinding to the web.config.

    
      
        
          
            
              
              
              
              
            
          
        
        
          
        
      
      
        
      
    
    

    After adding customBinding, I can pass username and password to client service like as follows:

    service.ClientCridentials.UserName.UserName = "testUser";
    service.ClientCridentials.UserName.Password = "testPass";
    

    In this way you can pass username, password in the header to a SOAP WCF Service.

提交回复
热议问题