Vlad K
Vlad K

Reputation: 2851

Mule: How to prevent WS Consumer generating headers in the request?

I'm using WS Consumer component to call an external Web Servcie and I'm looking for a way to prevent generation of a SOAP header in the request.

I've found how to do this when using cxf component explicitly:

<cxf:configuration enableMuleSoapHeaders="false"/>

and then same in <cxf:jaxws-client ...

But I can't figure out how to achieve the same when using WS Consumer. So, can someone pls advice?

Thank you,

Upvotes: 0

Views: 364

Answers (1)

Vlad K
Vlad K

Reputation: 2851

Ok, I've found the answer by myself. Basically, WS Consumer (v3.7) doesn't have an attribute similar to the enableMuleSoapHeaders from the cxf component. So, you'll need to code the logic in java.

First, you need to code your own CXF interceptor that would go through the message and remove the unnecessary headers.

Then, you need to create a cxf configuration file (the default name is cxf.xml) and put it into the mule project classpath.

Once this is done, Mule will call the interceptor for every cxf message processed and remove the headers.

For more info about coding and configuring cxf interceptor look at the apache documentation here.

Upvotes: 1

Related Questions