Wednesday, April 17, 2024

VBCS - task4 - How to check Business objects rest endpoints and test rest endpoints

Here, we will see how to check business objects rest endpoints and test them.

Click on Business objects >> select BO here like Employee.>> click on Endpoints tab >>select one endpoint and click test tab






VBCS - Task3 - Create a business object diagram

We will create a diagram that provides a visual representation of the business objects and their relationships.

Business objects >> Diagrams >> + Business Object Diagram >> provide diagram name >> select the BOs .








Tuesday, April 16, 2024

VBCS - task2 - Create business objects and import data

Usecase: Here we will create couple of business objects in VBCS. We can achieve the same following 2 ways:

Way1: Create Business Object >> create fields >> import the data as csv file.

Way2: Import a zip file that defines business objects, their fields and data all at one step.


Detailed steps with Screenshots:

Way1: Create Business Object >> create fields >> import the data as csv file.

Here. We wil create a Location Business object.

Click Business Objects >> click + Business objects >> provide business object name >> click fields >> click + field and add field names and data type as necessary. >> create field >> select required column as needed. >> clcik data tab >> import from file.











Way2: Import a zip file that defines business objects, their fields and data all at one step.

Here, we will create Department and Employee Business objects, kept csv files in a zip file.


We have created a zip file having 2 csv filez for department and Employee.

Click on business objects >> click Menu (...) >> select data manager >> select import business objects >> upload zip file >> after import in fields steps we may need to make some changes like data type changes, like department BO, we will change the location field data type to reference type and will refer to location BO. We can also select required fields required in the BO.















VBCS - task1 - Create a web app

Usecase: Here we will create a Web application in VBCS.

Detailed steps with Screenshots:

Click new application and provide application name




The newly created visual app opens on the welcome page . It has following resources:

Create Apps(Responsive apps)
Coonect to Data(Service connections)
Add artifacts(components)
Business Objects


Create apps >> Responsive Apps >> web application>> provide web app name.

The vertical toolbar is the navigator. It has following parts:
Web applications
Services
Business Objects
Layouts
Components
Processes
Source



The hrwebpage opens the main-start page, which is the application's default home page.


Note: We will notice the hrwebpage node contains main node which in turn contains the main-start node. The main node the application's deafult flow containing the deafult page main-start. An application can have mutiple flows, each of which cab be used to group related pages. By convention, a page takes its flow name as a prefix.




Saturday, March 16, 2024

Employees XSD and WSDL | oneway employee create wsdl

 

XSD used:
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://org.cognizant.com/Employees/v1.0"
            targetNamespace="http://org.cognizant.com/Employees/v1.0" elementFormDefault="qualified">
  <xsd:element name="Employees">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Employee" type="EmployeeType" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="EmployeeType">
    <xsd:sequence>
      <xsd:element name="EMPLOYEE_ID" type="xsd:int"/>
      <xsd:element name="FIRST_NAME" type="xsd:string"/>
      <xsd:element name="LAST_NAME" type="xsd:string"/>
      <xsd:element name="AGE" type="xsd:int"/>
      <xsd:element name="DEPARTMENT_NAME" type="xsd:string"/>
      <xsd:element name="DEPARTMENT_ID" type="xsd:string"/>
      <xsd:element name="COUNTRY" type="xsd:string"/>
      <xsd:element name="SALARY" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

WSDL used:
<wsdl:definitions name="Employees" targetNamespace="http://org.cognizant.com/Employees/wsdl/v1.0"
                  xmlns:tns="http://org.cognizant.com/Employees/wsdl/v1.0" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:top="http://org.cognizant.com/Employees/v1.0">
  <wsdl:types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema">
      <xsd:import namespace="http://org.cognizant.com/Employees/v1.0" schemaLocation="Employees.xsd"/>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="InsertEmployeesRequest_msg">
    <wsdl:part name="parameters" element="top:Employees"/>
  </wsdl:message>
  <wsdl:portType name="InsertEmployees_ptt">
    <wsdl:operation name="insert">
      <wsdl:input message="tns:InsertEmployeesRequest_msg"/>
    </wsdl:operation>
  </wsdl:portType>
</wsdl:definitions>

Monday, March 11, 2024

OIC - XSLT - Find out the sum of all the invoice lines where each line having quantity and price using Call template

Usecase: we have a source json file where we have multiple items or lines and in each line we have line quantity and price. We have to find out the total amount of all the lines in XSLT.

Source payload:

{
  "gp_number" : "56826526",
  "lineLevel" : [ {
    "Qty" : "4.00",
    "Rate" : "50.00"
  }, {
    "Qty" : "3.00",
    "Rate" : "25.00"
  } ]
}


Target Payload:

{
  "gp_number" : "56826526",
  "AmountCal_line" : [ {
    "Qty" : "4.00",
    "Rate" : "50.00",
    "Amount" : "200.00"
  }, {
    "Qty" : "3.00",
    "Rate" : "25.00",
    "Amount" : "75.00"
  } ],
  "TotalAmount" : "275.00"
}

Xslt sample:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text" omit-xml-declaration="yes"/>

  <xsl:template match="/rootElement">
    <!-- Initialize sum variable -->
    <xsl:variable name="totalSum">
      <xsl:call-template name="calculateTotal">
        <xsl:with-param name="items" select="items/item"/>
      </xsl:call-template>
    </xsl:variable>


    <!-- Output the total sum -->
    <xsl:value-of select="$totalSum"/>
  </xsl:template>

  <xsl:template name="calculateTotal">
    <xsl:param name="items"/>
    <xsl:param name="sum" select="0"/>

    <!-- Check if there are more items to process -->
    <xsl:choose>
      <xsl:when test="$items">
        <!-- Calculate quantity multiplied by rate for the current item -->
        <xsl:variable name="itemTotal" select="$sum + $items[1]/qty * $items[1]/rate"/>
       
        <!-- Recursively call the template for the next item -->
        <xsl:call-template name="calculateTotal">
          <xsl:with-param name="items" select="$items[position() > 1]"/>
          <xsl:with-param name="sum" select="$itemTotal"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <!-- Return the final sum when all items are processed -->
        <xsl:value-of select="$sum"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>


Screenshots:








Monday, March 4, 2024

Sample Calculator WSDL

Sample Calculator WSDL:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:ns1="http://org.apache.axis2/xsd" 
xmlns:ns="http://c.b.a" 
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
targetNamespace="http://c.b.a">
    <wsdl:documentation>Calculator</wsdl:documentation>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" 
elementFormDefault="qualified" 
targetNamespace="http://c.b.a">
            <xs:element name="add">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="n1" type="xs:int" />
                        <xs:element minOccurs="0" name="n2" type="xs:int" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="addResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" type="xs:int" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="addRequest">
        <wsdl:part name="parameters" element="ns:add" />
    </wsdl:message>
    <wsdl:message name="addResponse">
        <wsdl:part name="parameters" element="ns:addResponse" />
    </wsdl:message>
    <wsdl:portType name="CalculatorPortType">
        <wsdl:operation name="add">
            <wsdl:input message="ns:addRequest" wsaw:Action="urn:add" />
            <wsdl:output message="ns:addResponse" wsaw:Action="urn:addResponse" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="CalculatorSoap11Binding" type="ns:CalculatorPortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
        <wsdl:operation name="add">
            <soap:operation soapAction="urn:add" style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="CalculatorSoap12Binding" type="ns:CalculatorPortType">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
        <wsdl:operation name="add">
            <soap12:operation soapAction="urn:add" style="document" />
            <wsdl:input>
                <soap12:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="CalculatorHttpBinding" type="ns:CalculatorPortType">
        <http:binding verb="POST" />
        <wsdl:operation name="add">
            <http:operation location="add" />
            <wsdl:input>
                <mime:content type="text/xml" part="parameters" />
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="parameters" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="Calculator">
        <wsdl:port name="CalculatorHttpsSoap11Endpoint" binding="ns:CalculatorSoap11Binding">
            <soap:address location="https://<host>:<port>/services/Calculator.CalculatorHttpsSoap11Endpoint/" />
        </wsdl:port>
        <wsdl:port name="CalculatorHttpSoap11Endpoint" binding="ns:CalculatorSoap11Binding">
            <soap:address location="http://<host>:<port>/services/Calculator.CalculatorHttpSoap11Endpoint/" />
        </wsdl:port>
        <wsdl:port name="CalculatorHttpSoap12Endpoint" binding="ns:CalculatorSoap12Binding">
            <soap12:address location="http://<host>:<port>/services/Calculator.CalculatorHttpSoap12Endpoint/" />
        </wsdl:port>
        <wsdl:port name="CalculatorHttpsSoap12Endpoint" binding="ns:CalculatorSoap12Binding">
            <soap12:address location="https://<host>:<port>/services/Calculator.CalculatorHttpsSoap12Endpoint/" />
        </wsdl:port>
        <wsdl:port name="CalculatorHttpsEndpoint" binding="ns:CalculatorHttpBinding">
            <http:address location="https://<host>:<port>/services/Calculator.CalculatorHttpsEndpoint/" />
        </wsdl:port>
        <wsdl:port name="CalculatorHttpEndpoint" binding="ns:CalculatorHttpBinding">
            <http:address location="http://<host>:<port>/services/Calculator.CalculatorHttpEndpoint/" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

Online wsdl generator:
http://marin.jb.free.fr/wsdl/

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...