文章目录
- 安装
- 安装准备
- 配置jdk
- 安装管理中心(manager)
- 安装运行时(server)
- 安装mysql并配置manager(新装阶段考虑)
- 放入授权
- 启动内置redis
- 启动内置redis
- 启动manager和server
- 停止manager和server
- 访问控制台
- 如何在控制台上重置密码
- 测试用到的各类文件
- WeatherWebService.wsdl
- bin.json
- bin.xml.xml
- student.json
- student.xml
- 测试
- http 转 ws
- ws转http
- xml报文转json报文
- 数据库服务化功能
- 问题收集
- 关闭验证码
安装
安装准备
jdk要求:jdk1.8
配置数据库:
支持MySQL、Oracle、达梦、Kingbase、GBase 5种数据库。
版本要求:
MySQL 5.7及以上、Oracle 11g、达梦 v8、Kingbase v8、GBase 8CV5
jdk链接如下:bishengjdk下载链接
配置jdk
vi /etc/profile
#这里的jdk路径换成你的jdk路径
JAVA_HOME=/opt/jdk1.8.0_391
JAVA_BIN=$JAVA_HOME/bin
JRE_HOME=$JAVA_HOME/jre
PATH=$JAVA_BIN:$JRE_BIN:$PATH
export JAVA_HOME JRE_HOME PATH
vi后esc输入:wq保存,然后source /etc/profile,输入java -version 查看是否生效:
安装管理中心(manager)
确认下快捷方式文件夹安装路径和安装路径,因为之后执行指令的时候要确认。
一般有以下选择:
1.用户默认路径,2.home目录,3.自定义路径。
本次示范使用自定义路径,实际情况建议根据自身需求来(也可以用用户默认路径,例如root用户,就建在root目录下)。
chmod +x *.bin
sh Install_TongESB_V7.1.0.0_Manage_Linux.bin -i console
执行后出现这个提示
建议选择为管理中心安装目录的上一级目录,例如我打算把管理中心安装在/opt/TongESB_V7.1.0.0_Manage,那就选择/opt
Where would you like to create links?
->1- Default: /root
2- In your home folder
3- Choose another location...
4- Don't create links
ENTER THE NUMBER OF AN OPTION ABOVE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
: 3
ENTER THE ABSOLUTE PATH TO THE SHORTCUT DIRECTORY
: /opt
SHORTCUT DIRECTORY IS: /opt/TongESB_V7.1.0.0_Manage_Linux_link
IS THIS CORRECT? (Y/N): y
输入3然后回车,输入你的快捷方式的目录(不用自己建)然后回车,输入y然后会回车。
接下来就是管理中心的安装选择:
Choose Install Folder
---------------------
Where would you like to install?
Default Install Folder: /root/TongESB_V7.1.0.0_Manage
ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
: /opt/TongESB_V7.1.0.0_Manage
INSTALL FOLDER IS: /opt/TongESB_V7.1.0.0_Manage
IS THIS CORRECT? (Y/N): y
如果要用它的默认路径,直接回车,否则输入指定目录,按回车,回车后输入y,继续回车。
接下来这两步不用管,直接回车
到这一步表示安装成功。
安装完毕输入ll看看
[root@localhost opt]# ll
总用量 1132412
-rwxr-xr-x. 1 root root 643663960 11月 18 17:58 Install_TongESB_V7.1.0.0_Manage_Linux.bin
-rwxr-xr-x. 1 root root 374026406 11月 18 17:58 Install_TongESB_V7.1.0.0_Server_Linux.bin
drwxr-xr-x. 8 root root 4096 11月 18 17:45 jdk1.8.0_391
-rw-r--r--. 1 root root 141887242 11月 18 17:45 jdk-8u391-linux-x64.tar.gz
drwxrwxr-x. 5 root root 80 11月 18 18:12 TongESB_V7.1.0.0_Manage
lrwxrwxrwx. 1 root root 96 11月 18 18:12 Uninstall_TongESB_V7.1.0.0_Manage -> /opt/TongESB_V7.1.0.0_Manage/TongESB_V7.1.0.0_Manage_Uninstall/Uninstall_TongESB_V7.1.0.0_Manage
类似这种说明安装成功
安装运行时(server)
chmod +x *.bin
sh Install_TongESB_V7.1.0.0_Server_Linux.bin -i console
跟manager一样,1.用户默认路径,2.home目录,3.自定义路径。
本次使用3,自定义路径。
Where would you like to create links?
->1- Default: /root
2- In your home folder
3- Choose another location...
4- Don't create links
ENTER THE NUMBER OF AN OPTION ABOVE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
: 3
ENTER THE ABSOLUTE PATH TO THE SHORTCUT DIRECTORY
: /opt
SHORTCUT DIRECTORY IS: /opt
IS THIS CORRECT? (Y/N): y
由于本次示范打算将server也就是进行时安装在/opt/TongESB_V7.1.0.0_Server下,所以输入它的上一级目录也就是/opt,回车,然后输入y确认。
之后会有这个提示:
如果用默认路径就回车,否则输入你的安装目录,回车。
之后的一直回车即可。
安装完后,ll看看是否跟这个一致:
安装mysql并配置manager(新装阶段考虑)
manager默认用的数据库是h2,出于后期数据维护,建议修改成mysql或者其他数据库。
本次示范修改成mysql。
备注:
1.如果要替换成mysql,一定一定要在esb的manager和server启动前替换完成,并且一定要确保mysql跟esb的通信没问题,不然很有可能出现例如esb控制台能登录,进去后发现数据缺失导致的各种问题。
2.本地尝试过在使用了自带h2数据库后替换mysql,直接控制台之前的集成流等数据都没有了,所以建议一定要在新装启动前做好替换mysql的准备。
mysql有docker版本和linux版本,考虑到大部分环境不一定使用docker版本,本次示范使用linux版本, 参考链接
mysql5.7安装
新建成功后,用navicat连接一下mysql
首先在mysql里建一个库,例如tonggis
进入到/opt/TongESB_V7.1.0.0_Manage/Manage/config目录里,找到set_env这个文件:
可以看到用的h2的
另外访问端口8080也可以在这里改
本次改动如下所示:
export IS_DB_TYPE=mysql
export IS_DB_URL="jdbc:mysql://127.0.0.1:3306/tongis?allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&characterEncoding=utf8"
export IS_DB_DRIVER=com.mysql.cj.jdbc.Driver
export IS_DB_USER=root
export IS_DB_PASSWORD=yeyehuo163
放入授权
启动内置redis
TongESB_V7.1.0.0_Manage的安装目录下有一个redis-linux的目录,里面有个redis.conf,可以配端口和服务密码(一般情况下建议不要改,直接用默认的)
一旦改动这里的话,/opt/TongESB_V7.1.0.0_Manage/Manage/config目录里,set_env这个文件也要改:
启动也很简单,在该目录执行
sh start_redis.sh
或
./start_redis.sh
停止的话,则在该目录执行
sh stop_redis.sh
或
./stop_redis.sh
启动内置redis
TongESB_V7.1.0.0_Manage的安装目录下有一个redis-linux的目录,里面有个redis.conf,可以配端口和服务密码(一般情况下建议不要改,直接用默认的)
一旦改动这里的话,/opt/TongESB_V7.1.0.0_Manage/Manage/config目录里,set_env这个文件也要改:
启动也很简单,在该目录执行
sh start_redis.sh
或
./start_redis.sh
停止的话,则在该目录执行
sh stop_redis.sh
或
./stop_redis.sh
启动manager和server
manager
[root@localhost Manage]# cd /opt/TongESB_V7.1.0.0_Server/Server
[root@localhost Server]# ./start.sh
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Server/Server]
JAVA_HOME is: /opt/jdk1.8.0_391
Starting the Server.
Server startup on pid: 30321.
loading runtime id ...
to start the httpProxy.
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Server/Server/httpProxy]
JAVA_HOME is: /opt/jdk1.8.0_391
/opt/TongESB_V7.1.0.0_Server/Server/httpProxy/http_proxy_start_type.txt is not exist, use default HTTP_TYPE: http !
check start HttpProxy by http protocol.
Starting the HttpProxy by http protocol.
HttpProxy by http protocol startup on pid: 30742.
server
[root@localhost ~]# cd /opt/TongESB_V7.1.0.0_Server/Server
[root@localhost Server]# ./start.sh
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Server/Server]
JAVA_HOME is: /opt/jdk1.8.0_391
Starting the Server.
runtime.txt already exists, delete the file, then Server will create a file named runtime.txt.
Server startup on pid: 15246.
loading runtime id ...
to start the httpProxy.
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Server/Server/httpProxy]
JAVA_HOME is: /opt/jdk1.8.0_391
/opt/TongESB_V7.1.0.0_Server/Server/httpProxy/http_proxy_start_type.txt is not exist, use default HTTP_TYPE: http !
check start HttpProxy by http protocol.
Starting the HttpProxy by http protocol.
HttpProxy by http protocol startup on pid: 15927.
首次启动,最好用navicat连一下mysql看看有没有表导入进来:
停止manager和server
manager
[root@localhost ~]# cd /opt/TongESB_V7.1.0.0_Manage/Manage
[root@localhost Manage]# ./stop.sh
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Manage/Manage]
JAVA_HOME is: /opt/jdk1.8.0_391
The redispid is 1075
BOTRESS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Manage/Manage/AccessManager]
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Manage/Manage/AccessManager]
JAVA_HOME is: /opt/jdk1.8.0_391
Closing the AccessManager.
Closing the Manage.
server
[root@localhost Server]# ./stop.sh
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Server/Server]
JAVA_HOME is: /opt/jdk1.8.0_391
Closing the Server.
begin agent process check
begin server process check
to stop the httpProxy.
LITHOPS_HOME RESULT: [/opt/TongESB_V7.1.0.0_Server/Server/httpProxy]
JAVA_HOME is: /opt/jdk1.8.0_391
/opt/TongESB_V7.1.0.0_Server/Server/httpProxy/http_proxy_start_type.txt is not exist, use default HTTP_TYPE: http !
Closing the httpProxy.
begin process check
访问控制台
使用服务器ip:8080/console 访问。
初始账号admn,初始密码adminadmin。
如何在控制台上重置密码
测试用到的各类文件
WeatherWebService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://WebXml.com.cn/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://WebXml.com.cn/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><a href="http://www.webxml.com.cn/" target="_blank">WebXml.com.cn</a> <strong></span><br /><br />&nbsp;</wsdl:documentation>
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://WebXml.com.cn/">
<s:element name="getSupportCity">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="byProvinceName" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getSupportCityResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="getSupportCityResult" type="tns:ArrayOfString"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true" type="s:string"/>
</s:sequence>
</s:complexType>
<s:element name="getSupportProvince">
<s:complexType/>
</s:element>
<s:element name="getSupportProvinceResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="getSupportProvinceResult" type="tns:ArrayOfString"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getSupportDataSet">
<s:complexType/>
</s:element>
<s:element name="getSupportDataSetResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="getSupportDataSetResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema"/>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getWeatherbyCityName">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="theCityName" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getWeatherbyCityNameResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="getWeatherbyCityNameResult" type="tns:ArrayOfString"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getWeatherbyCityNamePro">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="theCityName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="theUserID" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getWeatherbyCityNameProResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="getWeatherbyCityNameProResult" type="tns:ArrayOfString"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ArrayOfString" nillable="true" type="tns:ArrayOfString"/>
<s:element name="DataSet" nillable="true">
<s:complexType>
<s:sequence>
<s:element ref="s:schema"/>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="getSupportDataSetSoapOut">
<wsdl:part name="parameters" element="tns:getSupportDataSetResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getWeatherbyCityNameSoapOut">
<wsdl:part name="parameters" element="tns:getWeatherbyCityNameResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getWeatherbyCityNameProSoapOut">
<wsdl:part name="parameters" element="tns:getWeatherbyCityNameProResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getSupportProvinceSoapIn">
<wsdl:part name="parameters" element="tns:getSupportProvince">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getSupportCitySoapOut">
<wsdl:part name="parameters" element="tns:getSupportCityResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getWeatherbyCityNameProSoapIn">
<wsdl:part name="parameters" element="tns:getWeatherbyCityNamePro">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getSupportDataSetSoapIn">
<wsdl:part name="parameters" element="tns:getSupportDataSet">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getSupportCitySoapIn">
<wsdl:part name="parameters" element="tns:getSupportCity">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getSupportProvinceSoapOut">
<wsdl:part name="parameters" element="tns:getSupportProvinceResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getWeatherbyCityNameSoapIn">
<wsdl:part name="parameters" element="tns:getWeatherbyCityName">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="WeatherWebServiceSoap">
<wsdl:operation name="getSupportCity">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><br /><h3></p><br /></wsdl:documentation>
<wsdl:input message="tns:getSupportCitySoapIn">
</wsdl:input>
<wsdl:output message="tns:getSupportCitySoapOut">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSupportProvince">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><br /><h3></p><br /></wsdl:documentation>
<wsdl:input message="tns:getSupportProvinceSoapIn">
</wsdl:input>
<wsdl:output message="tns:getSupportProvinceSoapOut">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSupportDataSet">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><br><h3></p><br /></wsdl:documentation>
<wsdl:input message="tns:getSupportDataSetSoapIn">
</wsdl:input>
<wsdl:output message="tns:getSupportDataSetSoapOut">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWeatherbyCityName">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><br><h3></p><br /></wsdl:documentation>
<wsdl:input message="tns:getWeatherbyCityNameSoapIn">
</wsdl:input>
<wsdl:output message="tns:getWeatherbyCityNameSoapOut">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWeatherbyCityNamePro">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><br><h3></p><br /></wsdl:documentation>
<wsdl:input message="tns:getWeatherbyCityNameProSoapIn">
</wsdl:input>
<wsdl:output message="tns:getWeatherbyCityNameProSoapOut">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WeatherWebServiceSoap" type="tns:WeatherWebServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getSupportCity">
<soap:operation soapAction="http://WebXml.com.cn/getSupportCity" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSupportProvince">
<soap:operation soapAction="http://WebXml.com.cn/getSupportProvince" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSupportDataSet">
<soap:operation soapAction="http://WebXml.com.cn/getSupportDataSet" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWeatherbyCityName">
<soap:operation soapAction="http://WebXml.com.cn/getWeatherbyCityName" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWeatherbyCityNamePro">
<soap:operation soapAction="http://WebXml.com.cn/getWeatherbyCityNamePro" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="WeatherWebServicesoap12" type="tns:WeatherWebServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getSupportCity">
<soap12:operation soapAction="http://WebXml.com.cn/getSupportCity" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSupportProvince">
<soap12:operation soapAction="http://WebXml.com.cn/getSupportProvince" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSupportDataSet">
<soap12:operation soapAction="http://WebXml.com.cn/getSupportDataSet" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWeatherbyCityName">
<soap12:operation soapAction="http://WebXml.com.cn/getWeatherbyCityName" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWeatherbyCityNamePro">
<soap12:operation soapAction="http://WebXml.com.cn/getWeatherbyCityNamePro" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WeatherWebService">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><a href="http://www.webxml.com.cn/" target="_blank">WebXml.com.cn</a> <strong></span><br /><br />&nbsp;</wsdl:documentation>
<wsdl:port name="WeatherWebServiceSoap" binding="tns:WeatherWebServiceSoap">
<soap:address location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"/>
</wsdl:port>
<wsdl:port name="WeatherWebServicesoap12" binding="tns:WeatherWebServicesoap12">
<soap12:address location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
bin.json
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Host": "httpbin.org",
"Postman-Token": "7361a9a4-9fdd-45d4-8b38-f98bc49fa554",
"User-Agent": "PostmanRuntime/7.32.2",
"X-Amzn-Trace-Id": "Root=1-64703a66-683645b66009f06d43687e5d"
},
"origin": "118.122.120.68",
"url": "http://httpbin.org/get"
}
bin.xml.xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:sumResponse xmlns:ns2="http://webservice.tongtech.com/">
<args>7</args>
<headers>
<Accept>1</Accept>
<Accept-Encoding>1</Accept-Encoding>
<Host>1</Host>
<Postman-Token>1</Postman-Token>
<User-Agent>1</User-Agent>
<X-Amzn-Trace-Id>1</X-Amzn-Trace-Id>
</headers>
<origin>7</origin>
<url>7</url>
</ns2:sumResponse>
</soap:Body>
</soap:Envelope>
student.json
{
"name": "1",
"age": "1"
}
student.xml
<?xml version="1.0" encoding="utf-8"?>
<student>
<name>张三</name>
<age>18</age>
</student>
测试
http 转 ws
原理:
当我们访问这个网址的时候:
http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
可以发现这是一个获取天气预报的web服务,本次测试调用的就是这个web服务里的getsupportcity。
创建 soap 连接
上传WeatherWebService.wsdl。
下一步
点击验证,没问题就保存。
集中流管理创建集成流
增加一个soap_conn,选择getSupportCity。
保存
部署
获取调用地址
postman测试
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://WebXml.com.cn/">
<soap:Header/>
<soap:Body>
<web:getSupportCity>
<!--Optional:-->
<web:byProvinceName>四川</web:byProvinceName>
</web:getSupportCity>
</soap:Body>
</soap:Envelope>
得到结果
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<getSupportCityResponse xmlns="http://WebXml.com.cn/" xmlns="http://WebXml.com.cn/" xmlns="http://WebXml.com.cn/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<getSupportCityResult>
<string>成都 (56294)</string>
<string>泸州 (57602)</string>
<string>内江 (57504)</string>
<string>凉山 (56571)</string>
<string>阿坝 (56171)</string>
<string>巴中 (57313)</string>
<string>广元 (57206)</string>
<string>乐山 (56386)</string>
<string>绵阳 (56196)</string>
<string>德阳 (56198)</string>
<string>攀枝花 (56666)</string>
<string>雅安 (56287)</string>
<string>宜宾 (56492)</string>
<string>自贡 (56396)</string>
<string>甘孜州 (56146)</string>
<string>达州 (57328)</string>
<string>资阳 (56298)</string>
<string>广安 (57415)</string>
<string>遂宁 (57405)</string>
<string>眉山 (56391)</string>
<string>南充 (57411)</string>
</getSupportCityResult>
</getSupportCityResponse>
</soap:Body>
</soap:Envelope>
ws转http
创建http连接
输入url
http://httpbin.org/get
点击验证:
保存后,创建集成流,选择soap
上传文件
导入后选择方法getSupportCity:
填写请求url(自定义)
选择tostring方法
映射处填入${body}
增加一个httpconn:
增加数据映射
导入文件并按照图片所示建立映射(这里要用到测试文件里的bin.json和bin.xml.xml):
保存后,在集成流管理里部署后,到集成流运维那边复制一下调用地址:
放入postman测试
postman中的xml信息:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://WebXml.com.cn/">
<soap:Header/>
<soap:Body>
<web:getSupportCity>
<!--Optional:-->
<web:byProvinceName>四川</web:byProvinceName>
</web:getSupportCity>
</soap:Body>
</soap:Envelope>
得到结果:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://webservice.tongtech.com/">
<soap:Body>
<ns2:sumResponse>
<headers>
<Accept>*/*</Accept>
<Accept-Encoding>gzip, deflate, br</Accept-Encoding>
<Host>httpbin.org</Host>
<Postman-Token>7222fa3e-2e42-4c80-8f04-6f689365c86e</Postman-Token>
<User-Agent>PostmanRuntime/7.37.3</User-Agent>
<X-Amzn-Trace-Id>Root=1-67467f59-17c936c61d04223b384e06bc</X-Amzn-Trace-Id>
</headers>
</ns2:sumResponse>
</soap:Body>
</soap:Envelope>
</soap:Body>
</soap:Envelope>
xml报文转json报文
创建集成流
新增一个REST_API:
补充信息:
之后点逻辑,数据映射
导入student.xml和student.json文件
导入后会有这种提示
直接用默认的instance就好了,json导入同理。
导入后是这样的
点击这里,然后拖动到你要映射的字段
之后会有个弹窗,关掉它就可以了
同理操作完其他的字段映射,保存并退出:
点击部署
部署后去复制一下调用地址
在postman上测试
放入内容
<?xml version="1.0" encoding="utf-8"?>
<student>
<name>张三</name>
<age>18</age>
</student>
数据库服务化功能
备注:
1.需要保证数据库连接没问题,并且已创建测试用的数据库和表
创表语句:
CREATE TABLE Students (
id VARCHAR(50),
name VARCHAR(50),
age VARCHAR(50)
);
新建数据库连接器
填写连接信息
点击验证
保存后,去创建一个集成流,第一个选REST_API:
配置post方法,配置请求路径
选择数据库连接:
输入数据库名,选insert,刷新就可以看到我们要找的表:
看到里面有值后,点击保存集成流:
写入变量名
部署
复制调用地址
放入postman
{
"id": "1",
"name": "1",
"age": "1"
}
问题收集
关闭验证码
需联系东方通技术人员获取相关替换文件。
1.停止管理端 ./stop.sh。
2.备份
(1)备份 Manage\AccessManager\bin\lib\botress-am-management-api-rest.jar
(2)移除 Manage\AccessManager\bin\lib\botress-am-management-api-rest.jar
(3)替换补丁包botress-am-management-api-rest.jar到Manage\AccessManager\bin\lib(替换后记得检查用户和权限,要跟其他的jar包一致)
3.修改配置文件Manage\AccessManager\config\management.yml
,增加内容(记得要跟上一行对齐):
captcha: false
true表示开启,false表示关闭。
4.替换前端war包
(1)备份 Manage\deployment\peony-front.war
(2)移除 Manage\deployment\peony-front.war
(3)替换 补丁包peony-front.war到Manage\deployment\目录下(记得检查用户组和权限)
重启manager进行测试(./start.sh)