Thursday, 12 April 2019
Web Services are the easiest way to integrate 2 systems without having to worry about compatibility between platforms and / or programming languages. All that is needed is to have or, where appropriate, generate the WSDL (Web Services Definition Language) file and an environment that allows you to “consume” web services.
In this tutorial we will see how we can configure a Business Service in Siebel and generate the WSDL file for later use in an external application (the use of the WSDL file will be discussed in another post).
As an example let’s consider a function in Siebel that returns the full name from 2 input parameters: First Name and Last Name.
The first step is to create through Siebel Tools a new project called “ABPWebServices“.
Next step we create a new Business Service “WSAutana” with the CSSService class and inside the project “ABPWebServices“. It is very important to mark/activate the following checks:
- External Use
- Service Enabled
- Web Service Enabled
We added a new WSPrueba method with two First and Last Name input parameters and one FullName output parameter. The logic of the method will be very simple in our example and basically concatenate the values of the two input parameters and return the result obtained through the output parameter.
function WSPoreba (Inputs, Outputs)
{
try
{
var sName;
var sLast name;
var sFullName;
sNombre = Inputs.GetProperty(“Nombre”);
sLast Name = Inputs.GetProperty(“Last Name”);
sFullName = sName + ” ” + sLast Name;
Outputs.SetProperty(“FullName”, sFullName);
}
catch(e)
{
Outputs.SetProperty(“FullName”,”There is an error in Siebel”);
}
}
Once the logic we want is created, we download the Siebel Server service, compile the business service “WSAutana” and lift the service again.
Up to this point we have our business service created and compiled. All that remains is to register it as an Inbound web service and generate the corresponding WSDL file .
For this we need to connect to the application with an administrator user or any user who has access to the “Web Services” tab.
We enter the application and from Site Map we navigate to the Administration – Web Services view and choose the option “Input Web Services“
In the applet above we create a new record with the following data:
- Namespace : http://siebel.com/asi/
- Name : WSAutana
- Status : Active
- Comments: (the comment you consider appropriate to identify or describe the web service)
Save the log and go to the applet below “Service Ports“. Create a new record and click on the pick applet in the “Business service name/Workflow” field.
A new applet will open with the list of all available business services and workflows. Our business service although it is active and compiled will not appear in the list and therefore we have to create a new record with the following data:
- Name: WSAutana
- Deployment Type : Business Services
- Business service name/Workflow: (we display the list and look for our business service “WSAutana”)
Save the record (click on the OK button), select the new business service and accept the changes again.
Back to the parent applet “Service ports” fill in the following fields:
- Name: WSAutana
- Transport: HTTP
- Address: we modify the URL that Siebel updates by default to choose the HTTP option in the Transport. The url should look something like this:
http://autanasiebel/eai_esn/start.swe?SWEExtSource=SecureWebService&SWEExtCmd=Execute&UserName=SADMIN&Password=SADMIN
- Link: SOAP_DOC_LITERAL
We move on to the last applet called Operations and create a new record. The Operations applet practically describes the methods that can be invoked through web services.
In our case we only have a single method that we have called WSPrueba. We click on the field Visible name of the method we will open a pick applet with all the available methods we choose the record that interests us and we accept and save the changes.
At this point we have already prepared in Siebel our Web Service. Empty cache (click on the Empty Cache button in the main applet) and export the WSDL file by clicking on the Generate WSDL button.Important! If we save directly the file generated by Siebel we will see that by default it is saved with the extension .xml. This is not a mistake when you consider that WSDL is an xml-based language. However, it is a good practice to first open the generated file and then save it with the name you want and the WSDL extension.
