简体   繁体   中英

Access wcf service with clientCredentialType=“UserName” using soapui

I have a WCF service which I'm trying to access using SoapUI. The service is working fine and I'm able to access with a .net client application, but I'm not able to figure out how to access the service using SoapUI. In C# I specify the username and password for the client like this

var client = new xxxService.xxxServiceClient();
client.ClientCredentials.UserName.UserName = "xxxx";
client.ClientCredentials.UserName.Password = "xxxxx";

but how do I specify the client credentials in soapui or in the xml

This is what the request looks in soapui

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
   <soap:Header/>
   <soap:Body>
      <tem:GetUsers/>
   </soap:Body>
</soap:Envelope>

In Navigator window in soapUI click on your WSDL item. Second tab 'Service Endpoints' list all endpoints. Second and third columns are Username and Password. Enter your credentials there.

You need to add WS-Security Configuration to your request. Read this http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html

And see the section under "Username". And then in your testsuite in soapUI, be sure to add the ws-security conf you just created. That worked for me.

Soap UI on the bottom left in Request Properties tab double click "Username" and "Password" and changed. You are still getting errors change same tab "WSS-Password Type" PasswordText

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM