热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

MYSQL-SMP3.0:IntegrationGatewaywithMySQLDatasource(Part3)(图文)

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

  1. Log on to SMP 3.0 Admin: https://smpserver:port/Admin

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

27.png

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

4. Go to destinations tab, Create a new destination

Properties Values
Destination TypeDATABASE
Destination URLjdbc:mysql://MySQLSeverip/schema_name
Destination Drivercom.mysql.jdbc.Driver
Authentication TypeBasic Authentication
User NameDB User
PasswordDB password

28.PNG

5. Move to Services tab, click on deployed service employee_MYSQLDB.

    • Click on 'Add Destination ', select MYSQLDB from the drop-down.

    • Save and close.

1.png

6. Once done, open the service document,

1.png

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

1.png

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

1.png

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

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

1.png

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-TOKENFETCH
Content-Typeapplication/xml

1.png

RESPONSE :

    • 200 OK status message

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

1.png

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-TOKEN1B4687085D8F59B1CA21382DF17D535A
Content-Typeapplication/xml
    • Pass this xml text into the BODY

1006SACHINSHARMACHANDIGARHINDIA

1.png

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.

1.png

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

1.png

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-TOKEN1B4687085D8F59B1CA21382DF17D535A
Content-Typeapplication/xml
    • Pass this xml text into the BODY

xml version="1.0" encoding="UTF-8"?>

1003CHIPROGSAN FRANSUSA

1.png

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.

1.png

1.png

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-TOKEN1B4687085D8F59B1CA21382DF17D535A
Content-Typeapplication/xml

1.png

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.

1.png

1.png

NextPart 4

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

推荐阅读
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 在说Hibernate映射前,我们先来了解下对象关系映射ORM。ORM的实现思想就是将关系数据库中表的数据映射成对象,以对象的形式展现。这样开发人员就可以把对数据库的操作转化为对 ... [详细]
  • 本文介绍了在SpringBoot中集成thymeleaf前端模版的配置步骤,包括在application.properties配置文件中添加thymeleaf的配置信息,引入thymeleaf的jar包,以及创建PageController并添加index方法。 ... [详细]
  • MACElasticsearch安装步骤及验证方法
    本文介绍了MACElasticsearch的安装步骤,包括下载ZIP文件、解压到安装目录、启动服务,并提供了验证启动是否成功的方法。同时,还介绍了安装elasticsearch-head插件的方法,以便于进行查询操作。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • 解决VS写C#项目导入MySQL数据源报错“You have a usable connection already”问题的正确方法
    本文介绍了在VS写C#项目导入MySQL数据源时出现报错“You have a usable connection already”的问题,并给出了正确的解决方法。详细描述了问题的出现情况和报错信息,并提供了解决该问题的步骤和注意事项。 ... [详细]
  • Java验证码——kaptcha的使用配置及样式
    本文介绍了如何使用kaptcha库来实现Java验证码的配置和样式设置,包括pom.xml的依赖配置和web.xml中servlet的配置。 ... [详细]
  • r2dbc配置多数据源
    R2dbc配置多数据源问题根据官网配置r2dbc连接mysql多数据源所遇到的问题pom配置可以参考官网,不过我这样配置会报错我并没有这样配置将以下内容添加到pom.xml文件d ... [详细]
  • 本文介绍了使用cacti监控mssql 2005运行资源情况的操作步骤,包括安装必要的工具和驱动,测试mssql的连接,配置监控脚本等。通过php连接mssql来获取SQL 2005性能计算器的值,实现对mssql的监控。详细的操作步骤和代码请参考附件。 ... [详细]
  • 第一种<script>$(".eq").on(&qu ... [详细]
  • CSRF校验策略及装饰器和auth认证模块
    目录csrf跨站请求伪造csrf校验策略csrf相关装饰器auth认证模块auth认证相关模块及操作扩展auth_user表csrf跨站请求伪造钓鱼网站:模仿一个正规的网站让用户在 ... [详细]
  • PHP设置MySQL字符集的方法及使用mysqli_set_charset函数
    本文介绍了PHP设置MySQL字符集的方法,详细介绍了使用mysqli_set_charset函数来规定与数据库服务器进行数据传送时要使用的字符集。通过示例代码演示了如何设置默认客户端字符集。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • 这篇文章主要介绍vue中axios请求拦截的示例分析,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!axios简介axios是一个基于P ... [详细]
author-avatar
公安边防临高支队警务微博_821
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有