public function sendSoapRequest($action, $body = "")
    {
        $soap_schema_url = $this->config['schema_url'];
        $xml = $this->xmlRequest;
        $call = $xml->createElement('ns:' . $action);
        if ($body) {
            $bodyXml = SoapUtils::toXml($body);
            if ($bodyXml->hasChildNodes()) {
                foreach ($bodyXml->childNodes as $bodyChildNode) {
                    $bodyNode = $xml->importNode($bodyChildNode, true);
                    $call->appendChild($bodyNode);
                }
            }
        }

        $xmlBody = $xml->getElementsByTagNameNS($soap_schema_url, 'Body')->item(0);

        // cleanup if body already set
        foreach ($xmlBody->childNodes as $node) {
            $xmlBody->removeChild($node);
        }

        $xmlBody->appendChild($call);
        $this->debugSection("Request", $req = $xml->C14N());

        if ($this->isFunctional && $this->config['framework_collect_buffer']) {
            $response = $this->processInternalRequest($action, $req);
        } else {
            $response = $this->processExternalRequest($action, $req);
        }

        $this->debugSection("Response", (string) $response);
        $this->xmlResponse = SoapUtils::toXml($response);
        $this->xmlStructure = null;
    }
public function sendSoapRequest($action, $body = "")
    {
        $soap_schema_url = $this->config['schema_url'];
        $xml = $this->xmlRequest;
        $call = $xml->createElement('ns:' . $action);
        if ($body) {
            $bodyXml = SoapUtils::toXml($body);
            if ($bodyXml->hasChildNodes()) {
                foreach ($bodyXml->childNodes as $bodyChildNode) {
                    $bodyNode = $xml->importNode($bodyChildNode, true);
                    $call->appendChild($bodyNode);
                }
            }
        }

        $xmlBody = $xml->getElementsByTagNameNS($soap_schema_url, 'Body')->item(0);

        // cleanup if body already set
        foreach ($xmlBody->childNodes as $node) {
            $xmlBody->removeChild($node);
        }

        $xmlBody->appendChild($call);
        $this->debugSection("Request", $req = $xml->C14N());

        if ($this->isFunctional && $this->config['framework_collect_buffer']) {
            $response = $this->processInternalRequest($action, $req);
        } else {
            $response = $this->processExternalRequest($action, $req);
        }

        $this->debugSection("Response", (string) $response);
        $this->xmlResponse = SoapUtils::toXml($response);
        $this->xmlStructure = null;
    }
public function sendSoapRequest ( $ action , $ body = "" ) { $ soap_schema_url = $ this -> config [ 'schema_url' ] ; $ xml = $ this -> xmlRequest ; $ call = $ xml -> createElement ( 'ns:' . $ action ) ; if ( $ body ) { $ bodyXml = SoapUtils :: toXml ( $ body ) ; if ( $ bodyXml -> hasChildNodes ( ) ) { foreach ( $ bodyXml -> childNodes as $ bodyChildNode ) { $ bodyNode = $ xml -> importNode ( $ bodyChildNode , true ) ; $ call -> appendChild ( $ bodyNode ) ; } } } $ xmlBody = $ xml -> getElementsByTagNameNS ( $ soap_schema_url , 'Body' ) -> item ( 0 ) ; // cleanup if body already set foreach ( $ xmlBody -> childNodes as $ node ) { $ xmlBody -> removeChild ( $ node ) ; } $ xmlBody -> appendChild ( $ call ) ; $ this -> debugSection ( "Request" , $ req = $ xml -> C14N ( ) ) ; if ( $ this -> isFunctional && $ this -> config [ 'framework_collect_buffer' ] ) { $ response = $ this -> processInternalRequest ( $ action , $ req ) ; } else { $ response = $ this -> processExternalRequest ( $ action , $ req ) ; } $ this -> debugSection ( "Response" , ( string ) $ response ) ; $ this -> xmlResponse = SoapUtils :: toXml ( $ response ) ; $ this -> xmlStructure = null ; }
Submits request to endpoint.

Requires of api function name and parameters.
Parameters can be passed either as DOMDocument, DOMNode, XML string, or array (if no attributes).

You are allowed to execute as much requests as you need inside test.

Example:

``` php
$I->sendSoapRequest('UpdateUser', '<user><id>1</id><name>notdavert</name></user>');
$I->sendSoapRequest('UpdateUser', \Codeception\Utils\Soap::request()->user
->id->val(1)->parent()
->name->val('notdavert');
```

@param $request
@param $body
Submits request to endpoint .