/** * @test */ public function shouldNotGenerateHeaderWhenIsNotNeeded() { //when $soapHeaderIfNeeded = $this->XMLUse->generateSoapHeaderIfNeeded($this->DOMDocument, $this->targetNamespace, $this->soapHeaderMessage, null, $this->soapVersion); //then $this->assertNull($soapHeaderIfNeeded); }
/** * @param string $methodName * @param DOMElement $soapBodyElement * @param DOMElement $element * @param string $elementName * @param string $headerName * @param Parameter|null $header */ private function bindingElement($methodName, DOMElement $soapBodyElement, DOMElement $element, $elementName, $headerName, Parameter $header = null) { $targetNamespace = $this->builder->getTargetNamespace(); $inputElement = $this->createElement($elementName); $inputElement->appendChild($soapBodyElement->cloneNode()); $soapHeaderMessage = 'tns:' . $methodName . $headerName; $soapHeaderElement = $this->XMLUse->generateSoapHeaderIfNeeded($this->DOMDocument, $targetNamespace, $soapHeaderMessage, $header, $this->XMLSoapVersion); if ($soapHeaderElement) { $inputElement->appendChild($soapHeaderElement); } $element->appendChild($inputElement); }