Studio Visual Editor
-
On your canvas, click the Global Elements tab, then click the Create button, then select
CXF Configuration
from the list of available options under Component configurations.You can also create a Global CXF Element directly from the CXF component’s properties editor. Next to the Config Reference field, click the plus sign icon to open the Global Element Properties panel. -
Configure the global CXF configuration attributes according to the table below.
Field
Value
Description
Name
unique name
Enter a unique name for the global element, if you wish.
Configuration Location
filepath/filename.xml
If you have created an
.xml
file that supplies the specifics of how you want your CXF elements to behave, enter the file path of your CXF configuration file.Enable Mule Soap Headers
true (default)
false
Note: This field is currently not implemented and has no effect.If set to true (i.e. checked) this attribute ensures that Mule can add a header to a SOAP message when required as part of the message’s processing.
For example, if your SOAP messages will be processed by a third-party schema which prohibits deviations from very specific message properties and will not process messages with Mule headers, set this attribute to false (i.e. uncheck).Initialize Static Bus Instance
true (default)
falseIf set to true, (i.e. checked) this attribute ensures that the CXF SOAP API uses Mule transports instead of CXF transports.
-
Click the Message Flow tab to return to your canvas.
-
Open the Pattern Properties panel of the CXF component, again.
-
Use the drop down menu in the Config Reference field to select the global CXF element you created.
-
Click OK to save your changes to the CXF component.
XML Editor or Standalone
-
Above all flows in your Mule project, add a global <cxf:configuration> element. Refer to code sample below.
-
Configure the global CXF configuration attributes according to the table below.
Attribute Value Description name
unique name
Enter a unique name for the global element, if you wish. (not required for Mule Standalone)
enableMuleSoapHeaders
true
false Note: This field is currently not implemented and has no effect.If set to true`,` this attribute ensures that Mule can add a header to a SOAP message when required as part of the message’s processing.
For example, if your SOAP messages will be processed by a third-party schema which prohibits deviations from very specific message properties and will not process messages with Mule headers, set this attribute to false.initializeStaticBusInstance
true
falseIf set to true, (i.e. checked) this attribute ensures that the CXF SOAP API uses Mule transports instead of CXF transports.
configurationLocation
filepath/filename.xml
If you have created an
.xml
file that supplies the specifics of how you want your CXF elements to behave, enter the file path of your CXF configuration file. -
To the CXF element within your flow, add a
configuration-ref
attribute to reference the global CXF configuration element. Refer to code sample below.<mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd"> <cxf:configuration name="CXF_Configuration" enableMuleSoapHeaders="true" initializeStaticBusInstance="true" doc:name="CXF Configuration" configurationLocation="src/test/resources/filename.xml"/> <http:listener-config name="listener-config" host="localhost" port="8081"/> <http:request-config name="request-config" host="localhost" port="8081"/> <flow name="example_flow1" doc:name="example_flow1"> <http:listener config-ref="listener-config" path="/" doc:name="HTTP Connector"/> <cxf:jaxws-client doc:name="SOAP" configuration-ref="CXF_Configuration"/> <http:request config-ref="request-config" path="/" method="POST" doc:name="HTTP Connector"/> </flow>