EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only

SOAP WEB AUTHENTICATION-COBOL

By Dionne Nerissa posted Thu December 21, 2023 01:34 AM

  

This blog describes a procedure to authenticate SOAP service where CICS is a SOAP Provider through this blog.

Objective:

We have introduced (Rational Business Developer 9.6.1) the user authentication at CICS to authorize the SOAP requester before providing access to the CICS SOAP Service.  

After successful authentication, the SOAP requester needs to provide valid credentials, typically in the form of a username and password, as a part of the SOAP request in the SOAP Header of the WSDL request by the SOAP Client.

Also introducing a new field, WSDL Policy for Authentication services. Select UsernameTokenOverHTTP option, which includes the WSDL Authentication policy in WSDL.

Pre-Requisites:

  •  A TCPIPSERVICE definition is required in a service provider that uses the HTTP transport. It contains information about the port on which inbound requests are received.

  • To authenticate a SOAP service at the provider side, the user needs to define a new PIPELINE resource definition.
     It allows the user to configure the authentication mechanism for the SOAP service under the <service_handler_list> tag.   

Error Handling

CICS Header program will send the error message "Security Token could not Authenticate" to the SOAP Client in case of invalid user credentials. This error message indicates that the authentication process failed due to incorrect or invalid user credentials. The end user needs to provide valid credentials to proceed.

Steps to Create Service Creation in RBD Workspace (CICS as provider):

Step-1: Service Project Creation

Follow the below steps to create a Service project.

1. Navigate to File --> New --> EGL project.   2. EGL Project window will appear.

3. Enter the Project name.

4. Select General Project and click Next.

5. Select COBOL as the Target runtime platform and Click Finish.

 6. The websoapprovider project has been successfully created under Project Explorer.

Step-2: Interface Creation

Follow the below steps to create an Interface.

1. Go to the Project Explorer and navigate to websoapprovider --> EGL Source.

2. Right-click the EGLSource and go to New --> Interface.

3. Enter the Package name and EGL source file name.

4. Click Finish.

5. Interface has been successfully created and Websoap.egl file will open.

             6. Copy and paste the code below in websoap.egl and Save.

package packs;

interface websoap 

             function concentrate(parm1 string in, parm2 string in) returns (string)

end

                              

Step-3: Service Creation

Follow the below steps to create a Service.

1. Go to the Project Explorer.

2. Under the Project Explorer, navigate to websoapprovider --> EGL Source.

3. Right-click EGLSource.

4. Go to New --> Service.

5. Enter the Package name and EGL source file name.

6. Click Add… to implement the interface on the service.  

7. Click Finish.

8. Service has been successfully created and opened in the EGL editor.

Step-4: Service Code

Add the below code in conservices.egl

               parm3 string;

     parm3=parm1::parm2;

     Return(parm3);

Step-5: Build Descriptor

Follow the below steps for Build Descriptor:

1. Go to the Project Explorer and navigate to websoapprovider --> EGL Source.

2. Open websoapprovider.eglbld file.

3. Add the required parameters by double-clicking and Save the respective field.

Step-6: Deployment Descriptor

This deployment descriptor generates the WSDL and WSBIND files along with the wrapper program. Users should not select existing WSDL files to evaluate the user credentials in SOAP requests. 

Follow the below steps for Deployment Descriptor:

1. Go to the Project Explorer and navigate to websoapprovideràEGL Source. 

2. Open websoapprovider.egldd file.

3. Select the option UsernameTokenOverHTTP to create user credential tags in the WSDL xml file.

Step-7: Client Creation in RBD Workspace (RUI as a consumer)

Follow the below steps to create RBD workspace:

1. Navigate to File --> New --> EGL project.  

2. The EGL Project window will appear.

3. Enter the Project name.

4. Select the Rich UI Project option and click Next.

5. The EGL Rich UI Project window will appear.

6. Select the required Widget libraries checkbox.

7. Click Next and then Finish. 

8. The RUI project has been successfully created under the Project Explorer view. 

Step-8: Create an RUI Handler

Follow the below steps to create an RUI handler.

1. Go to Project Explorer and navigate to the RUI project.

2. Right-click the RUI project and go to New --> Rich UI handler.

3. Enter the Package name and EGL source file name.

4. Click Finish.

5. The RUI handler has been successfully created in the RUI Project.

Step-9: Service Binding in Deployment Descriptor

Follow the below steps to create a service binding in the deployment descriptor.

1. Go to the Project Explorer and navigate to WebRUI --> EGL Source.

2. Double-click the WebRUI.egldd

3. Click Add…

4. Select SOAP service binding as Binding Types.

5. Browser the wsdl file and click Finish.

Step-10: Client code

Follow the below steps to add client code.

1. Expand the WebRUIàpacksà handlers.egl handler.

2. Copy the code and Save.

package packs;

// RUI Handler

import com.ibm.egl.rui.widgets.GridLayout;

import dojo.widgets.DojoButton;

import com.ibm.egl.rui.widgets.GridLayoutData;

import com.ibm.egl.rui.widgets.TextLabel;

import dojo.widgets.DojoTextField;

//

//

handler handlers type RUIhandler {initialUI = [ ui ],onConstructionFunction = start, cssFile="css/WebRUI.css", title="handlers"}

      

       ui GridLayout{ columns = 3, rows = 4, cellPadding = 4, children = [ TextField2, TextField1, TextField, TextLabel1, TextLabel, Button ] };

       Button DojoButton{ layoutData = new GridLayoutData{ row = 4, column = 2 }, text = "Concentrate", onClick ::= Button_onClick };

       TextLabel TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "String 1" };

       TextLabel1 TextLabel{ layoutData = new GridLayoutData{ row = 2, column = 1 }, text = "String 2" };

       TextField DojoTextField{ layoutData = new GridLayoutData{ row = 1, column = 2 }};

       TextField1 DojoTextField{ layoutData = new GridLayoutData{ row = 2, column = 2 }};

       TextField2 DojoTextField{ layoutData = new GridLayoutData{ row = 3, column = 2 }};

      

       function start()

       end

      

       function Button_onClick(event Event in)

       conservices conservices {@bindService};

             call conservices.concentrate(TextField.text, TextField1.text) returning to result;

       end

       function result(retResult string in)

             TextField2.text=retResult;

       end   

end

3. Go to the Project Explorer.

4. Under the Project Explorer, navigate to WebRUI --> EGL Source.

5. Open the WebRUI.egldd

6. select the Target project as webtart and Save. 

7. Generate and deploy the RUI Project by right-clicking WebRUI project.

Step-11: Run the HTML File

Follow the below steps to run the HTML file.

1. Go to the Project Explorer and navigate to webtart --> webcontent.

2. Right-click the client1-en_US.html and go to Run As --> Run on Server.

3. Go to Run AsàRun on Server.

4. Enter String 1 and String 2 values.

5. Click the Concatenate button.

6. GoodDay must be displayed in the text field as below

Limitations:

There are some restrictions on this feature. 

  • Only Basic authentication is supported by CICS. 
  • Encryption / Digital signatures would not be validated at CICS.
  • The authentication process is implemented only for the cases where CICS acts as a service provider.

Nandhini A

QA Engineer – RBD

0 comments
23 views

Permalink