Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Use of toolkit through ESB : invalid soap-header #67

Open
StefaanSomers opened this issue Oct 13, 2016 · 0 comments
Open

Use of toolkit through ESB : invalid soap-header #67

StefaanSomers opened this issue Oct 13, 2016 · 0 comments

Comments

@StefaanSomers
Copy link

StefaanSomers commented Oct 13, 2016

We do our communication with Salesfore not directly, but through Enterprise Solution Bus. So we don't need to login anymore to salesforce, but just the API-request to the ESB who will do his communication with Salesforce. But the ESB needs a special soap-header.

<soapenv:Header>
    <ns1:header soapenv:actor=“http://schemas.xmlsoap.org/soap/actor/next” soapenv:mustUnderstand=“0” xmlns:ns1=“http://www.xxxx.com/xsd/esb/ESBCommonTypes”>
    <ns1:message_type>SF_ENTPRISE_Interface</ns1:message_type>
    <ns1:version>01.80</ns1:version>
    <ns1:source_entity>xxxx</ns1:source_entity>
    <ns1:source_application>xxx</ns1:source_application>
    <ns1:destination_entity>xxx</ns1:destination_entity>
    <ns1:destination_application>xxx</ns1:destination_application>
    <ns1:message_id></ns1:message_id></ns1:header>
</soapenv:Header>

So I try to modify SfBaseClient, the method

private function setHeaders($call=NULL) {
......

      $soapHeader=new SoapHeader('http://www.leaseplan.com/xsd/esb/ESBCommonTypes', 'header', array (
            'client'=> 'test',
            'defaultNamespace'=> 'test',
            'message_type' => 'xxxx',
            'version' => '01.80',
            'source_entity' => 'xxx',
            'source_application' => 'LNOTES',
            'destination_entity'=> 'xx',
            'destination_application'=> 'SFxxxBE'
        ));


        array_push($header_array, $soapHeader);

        $this->sforce->__setSoapHeaders($header_array);

But when doing this, I always get
Fatal error: SoapClient::__setSoapHeaders(): Invalid SOAP header in C:\var\sourceRepositories\salesforce\Force.com-Toolkit-for-PHP-master\soapclient\SforceBaseClient.php on line 337

How can I obtain this functionality

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant