mysql smp_MYSQL-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 serviceLog on to SMP 3.0 Admin: https://smpserver:port/Admin

Create a new security profile with name as ' sap ' (exact name as namespace) under Settings>Security profiles>New

1405K4955A620-203R0.jpg

3. Log on to SMP3 gateway cockpit https://smpserver:port/gateway/cockpit

4. Go to destinations tab, Create a new destinationPropertiesValuesDestination TypeDATABASE

Destination URLjdbc:mysql://MySQLSeverip/schema_name

Destination Drivercom.mysql.jdbc.Driver

Authentication TypeBasic Authentication

User NameDB User

PasswordDB password

1405K495610940-2141L.jpg

5. Move to Services tab, click on deployed service employee_MYSQLDB.Click on 'Add Destination ', select MYSQLDB from the drop-down.

Save and close.

1405K49564DP-224510.jpg

6. Once done, open the service document,

1405K495D5940-23L05.jpg

http://smpserver:8080/gateway/odata/sap/employee_MySQLDB;v=1

1405K495G250-244b0.jpg

7. Open service metadata documentOData 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

1405K495J5310-259430.jpg

8. To get the details for the Entity 'employee'

smpserver:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee

1405K495N1250-262332.jpg

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,use HTTP GET verb to execute the same.Open Advanced REST client

REQUEST:URL: jk:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee

Use HTTP GET verb to execute this operation.

Pass below header valuesHeaderValuesX-CSRF-TOKENFETCH

Content-Typeapplication/xml

1405K495R3440-2HW1.jpg

RESPONSE :200 OK status message

X-CSRF-TOKEN value e.g. 1B4687085D8F59B1CA21382DF17D535A

1405K495V250-2T234.jpg

OData Operations – InsertEntity (CREATE)The InsertEntity operation creates an entity.

REQUEST :URL: jk:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee

Use HTTP POST verb to execute the InsertEntity operation.

Pass below header valuesHeaderValuesX-CSRF-TOKEN1B4687085D8F59B1CA21382DF17D535A

Content-Typeapplication/xmlPass this xml text into the BODY1006SACHINSHARMACHANDIGARHINDIA

1405K495Z-295338.jpg

RESPONSE :This operation creates an entity.

Successful execution of the operation returns HTTP 201 status code along with the Location of the newly created entity will be returned.

1405K49593Z60-30R47.jpg

1405K495aA60-31J38.jpg To verify, you can check with smpserver:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee(1006) OR directly in the MySQL database.

1405K496004E0-321621.jpg

OData Operations – UpdatetEntity (UPDATE)The UpdateEntity operation updates an entity.

REQUESTURL: jk:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee(1003)

Use HTTP PUT verb to execute the this operation.

Pass below header valuesHeaderValuesX-CSRF-TOKEN1B4687085D8F59B1CA21382DF17D535A

Content-Typeapplication/xmlPass this xml text into the BODY

xml version="1.0" encoding="UTF-8"?>1003CHIPROGSAN FRANSUSA

1405K496040620-333952.jpg

RESPONSE :If the update is successful, the server responds with 204 status code .As the response code text " No Content " signifies, no data is returned in the Response Body.

1405K4960N120-34OW.jpg

1405K496121X0-35A52.jpg

OData Operations – DeleteEntity (DELETE)The DeleteEntity operation deletes an entity.

REQUESTURL: jk:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee(1006)

Use HTTP DELETE verb to execute this operation.

Pass below header valuesHeaderValuesX-CSRF-TOKEN1B4687085D8F59B1CA21382DF17D535A

Content-Typeapplication/xml

1405K49615N10-3AQ5.jpg

RESPONSE :If the delete is successful, the server responds with 204 status code.

As the response code text " No Content " signifies, no data is returned in the Response Body.

1405K496193K0-3OT4.jpg

1405K4962343P-3V440.jpg

NextPart 4

以上就是MYSQL-SMP3.0 : Integration Gateway with MySQL Datasource (Part 3)(图文)的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:php中文网

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值