Tag Archives: SoapUI

JAX-WS: Generando un cliente de WS con SoapUI

Vamos a generar las clases necesarias para generar un cliente de un Web Service a partir de su WSDL.

Nos basaremos en el proyecto HelloWorld de hace unas semanas, y aquí le añadimos seguridad. En este proyecto devolvíamos el saludo según el nombre que nos pasaban como parámetro a través del Web Service.

Continue reading JAX-WS: Generando un cliente de WS con SoapUI

JAX-WS: Container level security on Weblogic

In this post we are going to see how to secure a Web Service with basic HTTP Auth, in weblogic. We will base in a previous project where we created a very basic WS: Hello World.

In the Security Realm > MyRealm we have to create:

  • An user: user/12345678
  • A group: TutorialUser
  • Add the user to the group

In the Weblogic console as we see on the picture:

Managing users and groups

In web.xml we have to add the security confs needed (path, basic type,….):

   <!--
    SECURITY
    -->
    <security-constraint>
        <display-name>Regla01</display-name>
        <web-resource-collection>
            <web-resource-name>WSPOST</web-resource-name>
            <description>
            <url-pattern>/*</url-pattern>
            <http-method>POST</http-method>
        </description>
        <auth-constraint>
            <description>
            <role-name>TutorialUser</role-name>
        </description>
    </auth-constraint>
    <session-config>
        <session-timeout>5</session-timeout>
    </session-config>
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>myrealm</realm-name>
    </login-config>
    <security-role>
        <description>
        <role-name>TutorialUser</role-name>
    </description>
</security-role>
</web-resource-collection>
</security-constraint>

In weblogic.xml map the application role with server role (it is mandatory):

    <wls:security-role-assignment>
        <wls:role-name>TutorialUser</wls:role-name>
        <wls:principal-name>TutorialUser</wls:principal-name>
    </wls:security-role-assignment>

We can test with SoapUI creating a new WS project, with WSDL address (http://localhost:7001/wsc/HelloService?WSDL) and previous Weblogic credentials created:

SoapUI Test