Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting SOAP header XML tag attribute in PHP

Tags:

php

soap

xml

I'm trying to send a SOAP request via PHP with the following header:

<soap:Header>
    <SecureSoapHeader SecureHeader="boolean" xmlns="http://www.capitafhe.co.uk/UNIT-e/">
      <settings>
        <Database>string</Database>
        <UserName>string</UserName>
        <Password>string</Password>
      </settings>
      <Database>string</Database>
      <UserName>string</UserName>
      <Password>string</Password>
    </SecureSoapHeader>
</soap:Header>

Using the PHP SOAP functions, I've managed to create a header equivalent to above (using tag prefixes in place of the xmlns attribute) except for the SecureHeader="boolean" bit. Is this possible using PHP's functions?

like image 200
marxjohnson Avatar asked Jan 25 '12 16:01

marxjohnson


1 Answers

You can try to create the headers the raw way.

Here is an example: http://www.php.net/manual/en/soapheader.soapheader.php#83026

like image 112
André Avatar answered Sep 25 '22 00:09

André