--- layout: doc title: SOAP - Codeception - Documentation ---
# SOAP Module for testing SOAP WSDL web services. Send requests and check if response matches the pattern. This module can be used either with frameworks or PHPBrowser. It tries to guess the framework is is attached to. If a endpoint is a full url then it uses PHPBrowser. #### Using Inside Framework Please note, that PHP SoapServer::handle method sends additional headers. This may trigger warning: "Cannot modify header information" If you use PHP SoapServer with framework, try to block call to this method in testing environment. ### Status * Maintainer: **davert** * Stability: **stable** * Contact: codecept@davert.mail.ua ### Configuration * endpoint *required* - soap wsdl endpoint * SOAPAction - replace SOAPAction HTTP header (Set to '' to SOAP 1.2) ### Public Properties * xmlRequest - last SOAP request (DOMDocument) * xmlResponse - last SOAP response (DOMDocument) ### Actions #### dontSeeSoapResponseContainsStructure Opposite to `seeSoapResponseContainsStructure` * `param` $xml #### dontSeeSoapResponseContainsXPath Checks XML response doesn't contain XPath locator {% highlight php %} dontSeeSoapResponseContainsXPath('//root/user[@id=1]'); ?> {% endhighlight %} * `param` $xpath #### dontSeeSoapResponseEquals Checks XML response equals provided XML. Comparison is done by canonicalizing both xml`s. Parameter can be passed either as XmlBuilder, DOMDocument, DOMNode, XML string, or array (if no attributes). * `param` $xml #### dontSeeSoapResponseIncludes Checks XML response does not include provided XML. Comparison is done by canonicalizing both xml`s. Parameter can be passed either as XmlBuilder, DOMDocument, DOMNode, XML string, or array (if no attributes). * `param` $xml #### grabAttributeFrom Finds and returns attribute of element. Element is matched by either CSS or XPath * `Available since` 1.1 * `param` $cssOrXPath * `param` $attribute * `return` string #### grabTextContentFrom Finds and returns text contents of element. Element is matched by either CSS or XPath * `Available since` 1.1 * `param` $cssOrXPath * `return` string #### haveSoapHeader Prepare SOAP header. Receives header name and parameters as array. Example: {% highlight php %} haveSoapHeader('AuthHeader', array('username' => 'davert', 'password' => '123345')); {% endhighlight %} Will produce header: {% highlight yaml %}