Custom SOAP envelope namespace in apex callout

816 views Asked by At

I am creating a SOAP call to Siebel and getting below SOAP envelope headers by default:

<env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
    <Security
        xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <UsernameToken>
            <Username>myUsername</Username>
            <Password>myPassword</Password>
        </UsernameToken>
    </Security>
</env:Header>
<env:Body>
 ----------

While siebel is expecting:

 <env:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"         xmlns:cus="http://siebel.com/customlink" xmlns:abcd="http://www.siebel.com/xml/xyz"
<env:Header>
    <Security
        xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <UsernameToken>
            <Username>myUsername</Username>
            <Password>myPassword</Password>
        </UsernameToken>
    </Security>
</env:Header>
<env:Body>
 ----------

Can you please help how to add the xmlns:cus and xmlns:abcd in SOAP header when I am making a webservice callout from apex (class created from WSDL provided by siebel)

1

There are 1 answers

0
Brian Hartung On

Remember that in Siebel you can always use a custom Filter Business Service to intercept a message (inbound and/or outbound). Occasionally this can be useful for things like logging the message while stripping out sensitive information like credentials, but it can also be used to transform the message if necessary (e.g. some system might not like a mustUnderstand attribute, others might require the namespace attributes to be stripped or added, others might need custom context headers to be added/removed, etc.). The integration documentation in Siebel bookshelf has examples on how you can modify the message through scripting.