Studio
-
On the Global Elements tab of the canvas, select
CXF Configuration
and click Create.The Choose Global Type dialog appears.
-
Select Component configurations > CXF Configuration.
-
Click OK.
The CXF Configuration dialog appears.
-
Configure the global CXF configuration attributes according to the following table:
-
In Name, enter a unique name for the global element (optional).
-
In Configuration Location, if you have created an
.xml
file that defines behavior of the CXF elements, enter the path and file name to the file in this format:filepath/filename.xml
-
Check the Enable Mule SOAP Headers checkbox to ensure that Mule can add a header to a SOAP message when required by the message processing.
-
In Initialize Static Bus Instance, check this option to ensure that the CXF SOAP API uses Mule transports instead of CXF transports. The default is checked.
-
-
Click OK.
Standalone XML
-
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 want (not required for Mule Runtime).
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>