implementing Ws-security within WCF proxy

前端 未结 2 1218
清酒与你
清酒与你 2021-02-06 15:59

I have imported an axis based wsdl into a VS 2008 project as a service reference.

I need to be able to pass security details such as username/password and nonce values t

2条回答
  •  無奈伤痛
    2021-02-06 16:40

    In order to call these kind of services, you will typically use either basicHttpBinding (that's SOAP 1.1 without WS-* implementations) or then wsHttpBinding (SOAP 1.2, with WS-* implementations).

    The main issue will be getting all the security parameters right. I have a similar web service (Java-based) that I need to call - here's my settings and code:

    app./web.config

    
       
          
             
                
                  
                
             
          
       
       
        
       
    
    

    and then in your client's code when calling the service, you need this snippet of code:

    IYourServiceClient client = new IYourServiceClient();
    
    client.ClientCredentials.UserName.UserName = "username";
    client.ClientCredentials.UserName.Password = "top-secret"; 
    

    Does that help at all?

提交回复
热议问题