Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get SoapUI to work with ws-security mode 'TransportWithMessageCredential'

I'm trying to create an example request in SoapUI, but i'm not sure how to get it working.

This is a working example in C#:

            var myService = new MyServiceClient("WSHttpBinding_MyService");

            myService .ClientCredentials.UserName.UserName = "User";
            myService .ClientCredentials.UserName.Password = "Password";

            var response = myService.MyMethod("parameter1");

Configuration:

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IMyService">
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="None" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://myWebsite.com:8000/MyService.svc"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"
          contract="MyService.IMyService" name="WSHttpBinding_IMyService" />
    </client>
  </system.serviceModel>

It seems to be that it should not be that hard to get this working in SoapUI, but i keep getting all kind of errors.

Does anyone has a working example for this?

like image 487
Jan V Avatar asked Sep 12 '25 12:09

Jan V


1 Answers

Double click the endpoint information to go into the property of the client endpoint, add Username/password credential and change the WSS-Type to PasswordText. As shown below.
enter image description here
Beside, because of the transport layer security, we are supposed to install the server's certificate in the trusted root certificate authority when the client calls it.
Feel free to let me know If there is anything I can help with.

like image 141
Abraham Qian Avatar answered Sep 15 '25 03:09

Abraham Qian