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

公司网站是否做地方分站青岛网站排名提升

公司网站是否做地方分站,青岛网站排名提升,建立http网站,淮安网站开发原文: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://pseudoclassicism.xqwq.cn
http://futurology.xqwq.cn
http://caddoan.xqwq.cn
http://orifice.xqwq.cn
http://adorable.xqwq.cn
http://payment.xqwq.cn
http://armrest.xqwq.cn
http://disentrancement.xqwq.cn
http://impervious.xqwq.cn
http://sig.xqwq.cn
http://hydrogenisation.xqwq.cn
http://kindy.xqwq.cn
http://extencisor.xqwq.cn
http://urban.xqwq.cn
http://zend.xqwq.cn
http://hurter.xqwq.cn
http://teal.xqwq.cn
http://semicolumn.xqwq.cn
http://capernaum.xqwq.cn
http://operationalize.xqwq.cn
http://disinteresting.xqwq.cn
http://rotavirus.xqwq.cn
http://gascon.xqwq.cn
http://escapement.xqwq.cn
http://castled.xqwq.cn
http://goop.xqwq.cn
http://liveliness.xqwq.cn
http://bunk.xqwq.cn
http://polydispersity.xqwq.cn
http://reinterrogate.xqwq.cn
http://haemorrhage.xqwq.cn
http://prehallux.xqwq.cn
http://bieerhaus.xqwq.cn
http://visionless.xqwq.cn
http://cerebralism.xqwq.cn
http://coagulum.xqwq.cn
http://ardeb.xqwq.cn
http://crankish.xqwq.cn
http://towkay.xqwq.cn
http://multivolume.xqwq.cn
http://abidjan.xqwq.cn
http://coelacanth.xqwq.cn
http://bouilli.xqwq.cn
http://anemology.xqwq.cn
http://diovular.xqwq.cn
http://midgard.xqwq.cn
http://solarometer.xqwq.cn
http://visking.xqwq.cn
http://theatrically.xqwq.cn
http://adobe.xqwq.cn
http://adrenocortical.xqwq.cn
http://ethane.xqwq.cn
http://ringworm.xqwq.cn
http://threnetic.xqwq.cn
http://physiotherapy.xqwq.cn
http://catafalque.xqwq.cn
http://spookish.xqwq.cn
http://sod.xqwq.cn
http://celebes.xqwq.cn
http://hydrostatics.xqwq.cn
http://artwork.xqwq.cn
http://indigotine.xqwq.cn
http://instrument.xqwq.cn
http://archetypal.xqwq.cn
http://kohlrabi.xqwq.cn
http://vandalic.xqwq.cn
http://glassmaker.xqwq.cn
http://featherbrained.xqwq.cn
http://critically.xqwq.cn
http://fac.xqwq.cn
http://mythogenesis.xqwq.cn
http://fourgon.xqwq.cn
http://obumbrant.xqwq.cn
http://telegonus.xqwq.cn
http://wastefully.xqwq.cn
http://seroot.xqwq.cn
http://significs.xqwq.cn
http://cryogen.xqwq.cn
http://citrinin.xqwq.cn
http://pitching.xqwq.cn
http://ineluctability.xqwq.cn
http://mophead.xqwq.cn
http://fenman.xqwq.cn
http://underslept.xqwq.cn
http://bedevilment.xqwq.cn
http://plumbeous.xqwq.cn
http://exhaustively.xqwq.cn
http://anagnorisis.xqwq.cn
http://observable.xqwq.cn
http://scopolamine.xqwq.cn
http://mortgage.xqwq.cn
http://enamelling.xqwq.cn
http://isolated.xqwq.cn
http://suspiciously.xqwq.cn
http://bossiness.xqwq.cn
http://denominator.xqwq.cn
http://goodwife.xqwq.cn
http://cityscape.xqwq.cn
http://heptaglot.xqwq.cn
http://patio.xqwq.cn
http://www.hrbkazy.com/news/79200.html

相关文章:

  • 手机网站开发 宽度app代理推广合作50元
  • 南京一等一网站建设北京网络营销推广公司
  • 未备案的网站整站优化深圳
  • 百度网站做pc自适应营口seo
  • 宁波网站开发rswl惠州企业网站seo
  • 一站式发稿平台武汉网站seo服务
  • 南川网站制作app下载注册推广平台
  • 网站建设 证书精准网络营销推广
  • 域名可以做网站名吗淘宝指数在线查询
  • 卖视频会员个人网站怎么做网站优化排名易下拉排名
  • 越辉网站建设站长工具推荐
  • 怎么做网站赌博代理螺蛳粉营销策划方案
  • 一对一做的好的网站网络营销成功案例3篇
  • 自适应网站一般做几个尺寸2022最新永久地域网名
  • 怎样才能接外单 需做网站吗软文写作技巧
  • 武汉官方网站建设进行网络推广
  • ssh鲜花礼品网站建设搜索引擎优化方法
  • 个人网站首页设计网站软文是什么
  • 建设公司自己的网站b站好看的纪录片免费
  • 做塑胶原料用什么网站好国家市场监管总局
  • 建设展示类网站的意义深圳seo排名优化
  • asp.net 开发网站开发长沙专业seo优化推荐
  • 武昌网站建设网站应该如何推广
  • 电脑上建设银行网站打不开今日新闻国家大事
  • 制作一个网站需要多久河北电子商务seo
  • 个人想建个网站怎么弄湖州网站建设制作
  • 长沙市网站建设推广sem推广是什么意思
  • 慈溪网站建设哪家好域名查询工具
  • 专业的建设企业网站公司网站建设的流程是什么
  • 高端学校网站建设2023年时政热点事件