当前位置: 首页 > news >正文

可以找题目做的网站seo中介平台

可以找题目做的网站,seo中介平台,baubauhaus设计网站,伊斯兰网站做合格穆斯林的条件原文:SOAP with TrinityCore | TrinityCore MMo Project Wiki 如何使用SOAP与TC交互 SOAP代表简单对象访问协议,是一种类似于REST的基于标准的web服务访问协议的旧形式。只要必要的配置到位,您就可以利用SOAP向TrinityCore服务器发送命令。 …

原文:SOAP with TrinityCore | TrinityCore MMo Project Wiki

 

如何使用SOAP与TC交互

SOAP代表简单对象访问协议,是一种类似于REST的基于标准的web服务访问协议的旧形式。只要必要的配置到位,您就可以利用SOAP向TrinityCore服务器发送命令。
理解SOAP的一个好方法是将其与当代REST进行比较。以下文章很好地解释了这一点——https://smartbear.com/blog/soap-vs-rest-whats-the-difference/.
两者之间的主要区别在于,SOAP完全依赖于XML来提供响应和接受有效载荷。PHP提供了一些使此过程更容易的方法,但根据您的使用情况,您可能需要熟悉XML。

配置


worldserver.conf
确保配置文件中的设置设置正确。

#    SOAP.Enable
#        Description: Enable soap service.
#        Default:     0 - (Disabled)
#                     1 - (Enabled)
SOAP.Enabled = 1#    SOAP.IP
#        Description: Bind SOAP service to IP/hostname.
#        Default:     "127.0.0.1" - (Bind to localhost)
SOAP.IP = "127.0.0.1"#    SOAP.Port
#        Description: TCP port to reach the SOAP service.
#        Default:     7878
SOAP.Port = 7878

考虑到您的特定RBAC访问配置,您还需要一个有权使用GM命令的用户帐户。专门为此目的创建一个受限访问帐户,而不是一个人使用的帐户,这可能是一个好主意。

注意:在撰写本文时,TC 335a仅支持HTTP,因此请注意不要以这种方式发送机密(密码等)。假设传递的任何内容都是明文形式,任何人都可以阅读。
如果您计划通过SOAP远程连接,您绝对应该采取措施确保安全连接。一种潜在的方法是通过apache或nginx通过反向SSL代理。但是,这不在本指南的范围内,将不包括在内。

用于原型制作的HTTP客户端


有一些客户端可以快速建立连接并测试控制台命令:
postman:https://www.postman.com/(网络、桌面代理/客户端)
insomnia:https://insomnia.rest/
夜莺nightingale:https://nightingale.rest/
它们都提供了各种各样的细节,但最终的工作原理大致相同。感谢Jackpoz为Postman提供的具体步骤-https://www.postman.com/.
Postman有两种风格:web界面(以及可以安装以执行localhost请求的代理)和完全客户端桌面应用程序。这两种情况下的说明是相同的。
在“我的工作区”下,找到“导入”按钮。您将使用原始文本选项。
将以下JSON复制并粘贴到文本框中。请确保将item.request.auth.basic下的凭据更新为前面提到的GM用户。

{"info": {"name": "TC SOAP","schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"},"item": [{"name": "server info","request": {"auth": {"type": "basic","basic": {"username": "CHANGEME","password": "CHANGEME","showPassword": false}},"method": "POST","header": [],"body": {"mode": "raw","raw": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"urn:TC\">\r\n<SOAP-ENV:Body>\r\n<ns1:executeCommand>\r\n<command>server info</command>\r\n</ns1:executeCommand>\r\n</SOAP-ENV:Body>\r\n</SOAP-ENV:Envelope>","options": {"raw": {"language": "xml"}}},"url": "http://127.0.0.1:7878"},"response": []}]
}

您应该将TC SOAP视为要导入的集合。单击“导入”。
这将使用正确的HTTP方法(POST)以及“授权”和“正文”选项卡下的详细信息填充新集合。
在Body选项卡下,注意XML负载和为您预先填充的服务器信息命令。
单击“发送”按钮将提交请求,并提供XML响应。
在Postman界面的右侧,一个</>符号将打开代码片段,可以将请求转换为您选择的语言。
¶使用PHP
要使用PHP与TrinityCore交互,您需要确保安装了PHP-soap扩展。还要确保您使用的是仍在积极支持的PHP版本。代码示例在PHP7.4到PHP8.1上进行了测试。
在所有这些示例中,urn:TC URI都是必需的参数,因为我们没有提供WSDL文档。
SoapClient-https://www.php.net/manual/en/class.soapclient.php

$command  = 'server info';$opts = ['http' => ['header' => "Authorization: Basic " . base64_encode("USERNAME:PASSWORD")]];$client = new SoapClient($wsdl = null, ['stream_context' => stream_context_create($opts),'location' => 'http://127.0.0.1:7878','uri' => 'urn:TC',
]);try {$result = $client->executeCommand(new SoapParam($command, 'command'));
} catch (\Exception $e) {die($e->getMessage());
}echo $result;

Note that we are passing a HTTP basic authorization header with base64 encoded username and password (separated by a colon). Alternatively, you could omit the stream_context parameter, and instead include a (login) username and password in your SoapClient configuration.

$command  = 'server info';$client = new SoapClient($wsdl = null, ['location' => 'http://127.0.0.1:7878','uri' => 'urn:TC','login' => 'USERNAME','password' => 'PASSWORD',
]);try {$result = $client->executeCommand(new SoapParam($command, 'command'));
} catch (Exception $e) {die($e->getMessage());
}echo $result;

Either approach is fine - but don't be fooled! Base 64 encoding does not inherently make it more secure.

Remember that the SOAP client can only recognize failures to connect, or misconfigurations. It will not know if you've provided an invalid command. So it's up to you to parse the results and decide if the intended result was a success or not. Output will be just as if you performed the command on the console.

Lastly, if you'd rather not rely on the SOAP extension or client, you can form the XML payload and parse the resulting XML response yourself. You'll still need the cURL extension, but this is usually available if not enabled by default.

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ns1="urn:TC"><SOAP-ENV:Body><ns1:executeCommand><command>server info</command></ns1:executeCommand></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
$curl = curl_init();curl_setopt_array($curl, [CURLOPT_POSTFIELDS => $payload, // $payload is the XML provided aboveCURLOPT_URL => 'http://127.0.0.1:7878',CURLOPT_TIMEOUT => 0,CURLOPT_CUSTOMREQUEST => 'POST',CURLOPT_HTTPHEADER => ["Authorization: Basic " . base64_encode("{$user}:{$pass}"),'Content-Type: application/xml',],
]);$response = curl_exec($curl);
curl_close($curl);
echo $response;

 

 

http://www.mnyf.cn/news/38043.html

相关文章:

  • WordPress添加内容评论可见seo查询爱站
  • 做房地产咨询网站怎么赢利百度广告大全
  • 网站建设时间影响因素百度搜索量怎么查
  • 一流的五屏网站建设专业做网站公司
  • 代做淘宝客网站永州网站seo
  • 福田网站建设哪家便宜广告最多的网站
  • 移动微网站建设二维码培训公司
  • 做网站什么价位软媒win7优化大师
  • ps做网站教程关键词林俊杰百度云
  • 国内贸易平台seo引擎
  • 山东平台网站建设企业直通车推广
  • 怎么制作网站维护公告效果软件商店安装
  • 免费的黄冈网站有哪些平台呢永久久seo诊断书案例
  • 专门做游戏的网站百度sem是什么意思
  • 网站制作关键技术全球疫情最新消息
  • 专业行业网站开发报价百度推广平台登录网址
  • 用java做的网站有哪些内容中国行业数据分析网
  • 如何添加插件到wordpressseo引擎优化外包公司
  • 网站详细报价淘宝店铺买卖交易平台
  • 同性男做的视频网站百度联盟项目看广告挣钱
  • 鞍山58同城二手房湖南正规关键词优化报价
  • dz论坛可以做招聘网站百度如何发布信息推广
  • 亚马逊网站建设与维护方法分析西安网站维护公司
  • 昆明汽车建站网站模板宝鸡网站seo
  • 苏州网页设计费用游戏优化大师官方下载
  • wordpress主题dux网站优化查询
  • 网站建设方案合同个人怎么创建网站
  • 做火锅加盟哪个网站好重庆网站建设与制作
  • 无锡建设招标网站班级优化大师下载安装app
  • 本地网站建设多少钱seo权重优化软件