SMP3.0: IntegrationGatewaywithMySQLDatasource (Part3) Here we will see how to create a destination in Gateway cockpit and map it manually to deployed OData service and then how to perform CRUD operation on service document.
Test the OData service
Log on to SMP 3.0 Admin: https: // smpserver: port/Admin
Create a new security profile with name'Sap'(Exact name as namespace) underSettings> Security profiles> New
3. Log on to SMP3 gateway cockpit https: // smpserver: port/gateway/cockpit
4. GoDestinationsTab, CreateNewDestination
Properties |
Values |
Destination Type |
DATABASE |
Destination URL |
Jdbc: mysql: // MySQLSeverip/schema_name |
Destination Driver |
Com. mysql. jdbc. Driver |
Authentication Type |
Basic Authentication |
User Name |
DB User |
Password |
DB password |
5. MoveServicesTab, click on deployed serviceEmployee_MYSQLDB.
6. Once done, open the service document,
Http: // smpserver: 8080/gateway/odata/sap/employee_MySQLDB; v = 1
7. Open service metadata document
OData defines a metadata format based on the Entity Data Model in XML (edmx ).
To access a service's metadata document use the $ metadata command.
The returned document is the service's edmx metadata + backend metadata
Smpserver: 8080/gateway/odata/sap/employee_MySQLDB; v = 1/$ metadata
8. To get the details for the Entity 'employee'
Smpserver: 8080/gateway/odata/sap/employee_MySQLDB; v = 1/employee
To fetch only first row of the table,
Smpserver: 8080/gateway/odata/sap/employee_MySQLDB; v = 1/employee (1001)
OData operations: RetrieveEntity (READ)
To retrieve details of a specific entity, useHTTP GETVerb to execute the same.
REQUEST:
Header |
Values |
X-CSRF-TOKEN |
FETCH |
Content-Type |
Application/xml |
RESPONSE:
OData Operations-InsertEntity (CREATE)
REQUEST:
Header |
Values |
X-CSRF-TOKEN |
1b4687085d8f59b1ca41582df17d535a |
Content-Type |
Application/xml |
1006SACHINSHARMACHANDIGARHINDIA
RESPONSE:
To verify, you can check with smpserver: 8080/gateway/odata/sap/employee_MySQLDB; v = 1/employee (1006) OR directly in the MySQL database.
OData Operations-UpdatetEntity (UPDATE)
REQUEST
Header |
Values |
X-CSRF-TOKEN |
1b4687085d8f59b1ca41582df17d535a |
Content-Type |
Application/xml |
Xml version = "1.0" encoding = "UTF-8"?>
1003CHIPROGSAN FRANSUSA
RESPONSE:
OData Operations-DeleteEntity (DELETE)
REQUEST
Header |
Values |
X-CSRF-TOKEN |
1b4687085d8f59b1ca41582df17d535a |
Content-Type |
Application/xml |
RESPONSE:
If the delete is successful, the server responds204 status code.
As the response code text"No Content"Signifies, no data is returned in the Response Body.
NextPart 4
The above is the MYSQL-SMP3.0: Integration Gateway with MySQL Datasource (Part 3) (text) content, more relevant content please pay attention to PHP Chinese network (www.php1.cn )!