I hope I can give some ideas for your needs.
In my case I had to change the NS too. But the Codeception SOAP module is build to just have 1 wsdl. So you have two options: "fork the Module and adapt it to your needs" or "modify the behaviour of that module".
I took the second.
This is how my SOAP test starts:
Class SiteRedshopbCategory100SoapCest
{
public function _before(ApiTester $I, \Helper\SoapModule $soapModule, \Codeception\TestCase\Cest $testCase)
{
$endpoint = 'http://mywebsite.com/index.php?webserviceClient=site&webserviceVersion=1.0.0&view=category&api=soap';
$schema = $I->getSoapWsdlDinamically($endpoint);
$soapModule->configure(
$testCase,
$endpoint,
$schema
);
}
public function create(ApiTester $I)
{
$I->wantTo('POST a new category using SOAP');
$I->amHttpAuthenticated('admin', 'admin');
$I->sendSoapRequest('create', "<name>Category1</name>");
$I->seeSoapResponseContainsStructure("<result></result>");
$I->dontSeeSoapResponseIncludes("<result>false</result>");
}
In tests/_support/ApiHelper I have defined the following function:
class ApiHelper extends \Codeception\Module
{
/**
* Cached WSDL files
*/
static private $schemas = [];
/**
* Returns the location of the Wsdl file generated dinamically
*
* @param string $endpoint The webservice url.
*
* @return mixed
*/
public function getSoapWsdlDinamically($endpoint)
{
// Gets cached WSDL static file from dynamic file
if (!isset(self::$schemas[$endpoint]))
{
$wsdl = simplexml_load_file($endpoint . '&wsdl');
$schema = $wsdl['targetNamespace'];
self::$schemas[$endpoint] = $schema;
}
return self::$schemas[$endpoint];
}
UPDATE: 17-feb-2016
I'm adding the Helper requested in the following comment
Needs to be created at: tests/_support/Helper/ folder (you can generate it with the command vendor/bin/codecept generate:helper SoapModule)
<?php
namespace Helper;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class SoapModule extends \Codeception\Module
{
public function configure($testcase, $endpoint, $schema)
{
$this->getModule('SOAP')->_reconfigure(
array(
'endpoint' => $endpoint,
'schema' => $schema,
)
);
//$this->getModule('SOAP')->buildRequest();
$this->getModule('SOAP')->_before($testcase);
}
}