Skip to content

Add shortcut functions for applying headers #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2022
Merged

Conversation

veewee
Copy link
Member

@veewee veewee commented Jan 28, 2022

Q A
Type improvement
BC Break no
Fixed issues php-soap/psr18-transport#3

Summary

This PR provides some builders for dealing with soap headers:

$builder = new SoapHeaders(
    new SoapHeader(
        $targetNamespace,
        'x:Auth',
        children(
            namespaced_element($targetNamespace, 'x:user', value('josbos')),
            namespaced_element($targetNamespace, 'x:password', value('topsecret'))
        ),
        // Optionally, you can provide additional configurators for setting
        // SOAP-ENV specific attributes:
        Actor::next(),
        new MustUnderstand()
    ),
    $header2,
    $header3
);

$headers = $doc->build($builder);
$doc->manipulate(new PrependSoapHeaders(...$headers));

@veewee veewee added the enhancement New feature or request label Jan 28, 2022
@veewee veewee merged commit dcf466d into php-soap:main Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant