MYSQL-SMP3.0 : Integration Gateway with MySQL Datasource (Part 3)(图文)
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 as ' sap ' (exact name as namespace) under Settings>Security profiles>New
3. Log on to SMP3 gateway cockpit https://smpserver:port/gateway/cockpit
4. Go to destinations tab, Create a new destination
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. Move to Services tab, click on deployed service employee_MYSQLDB.
Click on 'Add Destination ', select MYSQLDB from the drop-down.
Save and close.
6. Once done, open the service document,
http://smpserver:8080/gateway/odata/sap/employee_MySQLDB;v=1
7. Open service metadata document
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,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 values
Header | Values |
---|---|
X-CSRF-TOKEN | FETCH |
Content-Type | application/xml |
RESPONSE :
200 OK status message
X-CSRF-TOKEN value e.g. 1B4687085D8F59B1CA21382DF17D535A
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 values
Header | Values |
---|---|
X-CSRF-TOKEN | 1B4687085D8F59B1CA21382DF17D535A |
Content-Type | application/xml |
Pass this xml text into the BODY
1006SACHINSHARMACHANDIGARHINDIA
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.
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)
The UpdateEntity operation updates an entity.
REQUEST
URL: jk:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee(1003)
Use HTTP PUT verb to execute the this operation.
Pass below header values
Header | Values |
---|---|
X-CSRF-TOKEN | 1B4687085D8F59B1CA21382DF17D535A |
Content-Type | application/xml |
Pass this xml text into the BODY
xml version="1.0" encoding="UTF-8"?>
1003CHIPROGSAN FRANSUSA
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.
OData Operations – DeleteEntity (DELETE)
The DeleteEntity operation deletes an entity.
REQUEST
URL: jk:8080/gateway/odata/sap/employee_MySQLDB;v=1/employee(1006)
Use HTTP DELETE verb to execute this operation.
Pass below header values
Header | Values |
---|---|
X-CSRF-TOKEN | 1B4687085D8F59B1CA21382DF17D535A |
Content-Type | application/xml |
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.
NextPart 4
以上就是MYSQL-SMP3.0 : Integration Gateway with MySQL Datasource (Part 3)(图文)的内容,更多相关内容请关注PHP中文网(www.php.cn)!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

MySQL適合初學者使用,因為它安裝簡單、功能強大且易於管理數據。 1.安裝和配置簡單,適用於多種操作系統。 2.支持基本操作如創建數據庫和表、插入、查詢、更新和刪除數據。 3.提供高級功能如JOIN操作和子查詢。 4.可以通過索引、查詢優化和分錶分區來提升性能。 5.支持備份、恢復和安全措施,確保數據的安全和一致性。

使用 Navicat Premium 創建數據庫:連接到數據庫服務器並輸入連接參數。右鍵單擊服務器並選擇“創建數據庫”。輸入新數據庫的名稱和指定字符集和排序規則。連接到新數據庫並在“對象瀏覽器”中創建表。右鍵單擊表並選擇“插入數據”來插入數據。

Navicat本身不存儲數據庫密碼,只能找回加密後的密碼。解決辦法:1. 檢查密碼管理器;2. 檢查Navicat的“記住密碼”功能;3. 重置數據庫密碼;4. 聯繫數據庫管理員。

MySQL是一個開源的關係型數據庫管理系統。 1)創建數據庫和表:使用CREATEDATABASE和CREATETABLE命令。 2)基本操作:INSERT、UPDATE、DELETE和SELECT。 3)高級操作:JOIN、子查詢和事務處理。 4)調試技巧:檢查語法、數據類型和權限。 5)優化建議:使用索引、避免SELECT*和使用事務。

Navicat for MariaDB 無法直接查看數據庫密碼,因為密碼以加密形式存儲。為確保數據庫安全,有三個方法可重置密碼:通過 Navicat 重置密碼,設置複雜密碼。查看配置文件(不推薦,風險高)。使用系統命令行工具(不推薦,需要對命令行工具精通)。

可在 Navicat 中通過以下步驟新建 MySQL 連接:打開應用程序並選擇“新建連接”(Ctrl N)。選擇“MySQL”作為連接類型。輸入主機名/IP 地址、端口、用戶名和密碼。 (可選)配置高級選項。保存連接並輸入連接名稱。

MySQL和SQL是開發者必備技能。 1.MySQL是開源的關係型數據庫管理系統,SQL是用於管理和操作數據庫的標準語言。 2.MySQL通過高效的數據存儲和檢索功能支持多種存儲引擎,SQL通過簡單語句完成複雜數據操作。 3.使用示例包括基本查詢和高級查詢,如按條件過濾和排序。 4.常見錯誤包括語法錯誤和性能問題,可通過檢查SQL語句和使用EXPLAIN命令優化。 5.性能優化技巧包括使用索引、避免全表掃描、優化JOIN操作和提升代碼可讀性。

在 Navicat 中執行 SQL 的步驟:連接到數據庫。創建 SQL 編輯器窗口。編寫 SQL 查詢或腳本。單擊“運行”按鈕執行查詢或腳本。查看結果(如果執行查詢的話)。
