Example To REST Provider Service
Example To REST Provider Service
E-IB: Example for PeopleSoft REST provider service (GET/POST methods) (Doc ID 1533318.1)
<?xml version="1.0"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/Enterprise/Tools/schemas/mypackage.currency.v1"
xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/mypackage.currency.v1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="currency" type="currency_TypeShape"/>
<xsd:complexType name="currency_TypeShape">
<xsd:sequence>
<xsd:element minOccurs="0" name="currency_cd" type="currency_cd_TypeDef"/>
<xsd:element minOccurs="0" name="effdt" type="effdt_TypeDef"/>
<xsd:element minOccurs="0" name="eff_status" type="eff_status_TypeDef"/>
<xsd:element minOccurs="0" name="desc" type="desc_TypeDef"/>
<xsd:element minOccurs="0" name="descshort" type="descshort_TypeDef"/>
<xsd:element minOccurs="0" name="country" type="country_TypeDef"/>
<xsd:element minOccurs="0" name="cur_symbol" type="cur_symbol_TypeDef"/>
<xsd:element minOccurs="0" name="decimal_positions" type="decimal_positions_TypeDef"/>
<xsd:element minOccurs="0" name="scale_positions" type="scale_positions_TypeDef"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="currency_cd_TypeDef">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="effdt_TypeDef">
<xsd:restriction base="xsd:date">
<xsd:pattern value="(\d{4}-\d{2}-\d{2})"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="eff_status_TypeDef">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="desc_TypeDef">
import PS_PT:Integration:IRequestHandler;
method InboundSyncRequestHandler
end-method;
/*** Create SQL object to retrieve the values from the rowset ***/
&rec1 = CreateRecord(Record.CURRENCY_CD_TBL);
&SQL1 = CreateSQL("%selectall(:1) where CURRENCY_CD = :2", &rec1, &curr_cd);
If &SQL1.Fetch(&rec1) Then
&COM1.GetPropertyByName("currency_cd").Value = &rec1.CURRENCY_CD.Value;
&COM1.GetPropertyByName("effdt").Value = &rec1.EFFDT.Value;
&COM1.GetPropertyByName("eff_status").Value = &rec1.EFF_STATUS.Value;
&COM1.GetPropertyByName("descr").Value = &rec1.DESCR.Value;
&COM1.GetPropertyByName("descrshort").Value = &rec1.DESCRSHORT.Value;
&COM1.GetPropertyByName("country").Value = &rec1.COUNTRY.Value;
&COM1.GetPropertyByName("cur_symbol").Value = &rec1.CUR_SYMBOL.Value;
&COM1.GetPropertyByName("decimal_positions").Value = &rec1.DECIMAL_POSITIONS.Value;
&COM1.GetPropertyByName("scale_positions").Value = &rec1.SCALE_POSITIONS.Value;
End-If;
End-If;
End-If;
Return &response;
method onError
/+ &MSG as Message +/
/+ Returns String +/
/+ Extends/implements PS_PT:Integration:IRequestHandler.OnError +/
Local integer &nMsgNumber, &nMsgSetNumber;
Local string &str;
&nMsgNumber = &MSG.IBException.MessageNumber;
&nMsgSetNumber = &MSG.IBException.MessageSetNumber;
&str = &MSG.IBException.DefaultText;
Return &str;
end-method;