gpt4 book ai didi

php - Codeception SOAP 命名空间

转载 作者:行者123 更新时间:2023-12-03 22:57:35 26 4
gpt4 key购买 nike

在我的 SoapCest.php 中,我发送了一个 Soap 请求:

$I->sendSoapRequest('authenticate', ['sUsername' => 'abc', 'sPassword' => 'xyz']);

这会导致 XML 错误:

Procedure 'ns:authenticate' not present

这是正确的,因为应该使用 soap:authenticate 而不是 ns:authenticate 调用请求

如何更改测试调用的代码接收中的命名空间 ns:

最佳答案

在 2.5 版本中,您可以这样做:

<?php
namespace Helper;

class SoapAPI extends \Codeception\Module
{
public function configure(): void
{
$this->getModule('SOAP')->_reconfigure(['schema' => 'YourNamespace']);
}
}
<?php

class SoapTestCest
{

public function _before(SoapAPITester $I, \Helper\SoapAPI $soapModule): void
{
$soapModule->configure();
}
}

关于php - Codeception SOAP 命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34872451/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com