Example: Creating a new SOAP header

Draft comment:
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15
This example shows you how to create a new SOAP header for the ServiceMessageObject object inside a Custom Mediation primitive.

Context

The following code sample shows you how to create a new SOAP header for the ServiceMessageObject object inside a Custom Mediation primitive. The Custom Mediation primitive is used to replace the SOAP header inside an incoming ServiceMessageObject object.

Requirements

You must know how to set up a mediation flow with a Custom Mediation primitive.

Java™ imports

import com.ibm.websphere.sibx.smobo.SOAPHeaderType; 
import com.ibm.websphere.sibx.smobo.ServiceMessageObjectFactory;

Code sample

. 
. 
. 
ServiceMessageObjectFactory smoFactory = ServiceMessageObjectFactory.eINSTANCE; 
SOAPHeaderType SoapHeader = smoFactory.createSOAPHeaderType();
This code sample creates a new SOAP header. An exception occurs if the code sample fails.