PackageBase icon indicating copy to clipboard operation
PackageBase copied to clipboard

Update AbstractSoapClientBase.php

Open devloic opened this issue 1 year ago • 0 comments

As an enhancement (?) , for those who need to change the http header globally, we could allow stream_context to be passed through options once so it would not be necessary to call setHttpHeader() before each request.

The code for including some header would be :

$options = array( \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://somewebservice?wsdl', \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get(), );

$aHTTP['http']['header'] = "myheader: myheadervalue"; $context = stream_context_create($aHTTP); $options2=array_merge($options,array("stream_context" => $context));

$someservice = new \ServiceType\SomeServiceClass($options2);

includes fix from fougere2713/42_php8_compatibility_fix

devloic avatar May 28 '23 04:05 devloic