Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:38:50+00:00 2026-06-08T21:38:50+00:00

I have configured Camel SOAP proxy service using Spring DSL. Everything was working nice

  • 0

I have configured Camel SOAP proxy service using Spring DSL. Everything was working nice untill I found that I need to set a custom header inside for SOAP response message.

I am using spring-ws component and latest Camel 2.10.0.

Here is an example of my spring route (I skipped some irrelevant transformations):

<bean id="ahc_binding" class="ru.fabit.ExampleAHCBinding"/>

<bean id="response_assembler" class="ru.fabit.ExampleResponseAssembler"/>

<camel:camelContext id="get_regions">

    <camel:dataFormats>
        <camel:jaxb id="main_jaxb" prettyPrint="true"
                    contextPath="ru.fabit.rosstelecom.webservice.models.smev" />
    </camel:dataFormats>

    <camel:route>
        <camel:from uri="spring-ws:rootqname:{http://fabit.ru/service}getRegionsRequest?endpointMapping=#endpointMapping"/>

        <camel:unmarshal ref="main_jaxb"/>

        <camel:to uri="ahc:http://localhost:9001/service/regions"/>

        <camel:unmarshal ref="main_jaxb"/>

        <camel:process ref="response_assembler"/>

    </camel:route>
</camel:camelContext>

And here is the code for ExampleResponseAssembler.java (“response_assembler” bean). It is the last element in the route. And it’s responsibility to get unmarshalled response object from some external service (from AHC component, actually) and assemble the proper SOAP response for overall route.

public class ExampleResponseAssembler implements Processor {

    @Override
    public void process(final Exchange exchange) throws Exception {

        final Object responseMessage = exchange.getIn().getBody();
        final GetRegionsResponse regionsResponse = new GetRegionsResponse();
        final MessageDataType messageData = new MessageDataType();
        final AppDataType appData = new AppDataType();

        appData.setAny(responseMessage);
        messageData.setAppData(appData);
        regionsResponse.setMessageData(messageData);

        exchange.getOut().setBody(regionsResponse);

        final HeaderType header = exchange.getProperty("exampleHeader", HeaderType.class);
        exchange.getOut().setHeader("CamelSpringWebServiceSoapHeader", header);
    }
}

When I set the Body that way it is parsed correctly. I can see it in SaopUI. But header is not there. That was a naive approach to set the SOAP header I guess.
And I can’t find any relevant info about this.

Although I was able to find some JIRA tickets regarding this problem – link, it is still unclear how to handle with setting some custom SOAP headers. And ticket is marked as “unresolved”.
Maybe I need some override voodoo magick here (override MessageFactory, MessageSender or something else). Seems like a minor issue, but…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:38:51+00:00Added an answer on June 8, 2026 at 9:38 pm

    Seems to be an issue with a patch attached that might fix this.

    https://issues.apache.org/jira/browse/CAMEL-4515

    You could probably just implement your own component which derives from camel-spring-ws (not tested it though).

    In your overrided SpringWebServiceConsumer add the setting of headers (copy from exchange).
    In your overrided SpringWebServiceEndpoint override createConsumer to create your custom Consumer.
    In your overrided SpringWebServiceComponent override createEndpoint to create your custom endpoint.

    Should do the trick, maybe with some other code around it.
    Then just create your routes from your new component.

    You might want to download camel source and look at spring ws component, it’s not that much code in it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have configured in following way that spring MVC app using Spring 3.1.1.RELEASE web.xml
I have configured a Spring app (using Camel for integration with an ActiveMQ broker)
I have configured Service Broker communication between two SQL Server 2008 instances using Windows
i have a restful webservice configured using cxf and camel. My config xml is
I have configured my application to use the Service configuration Local in the development
I have configured Apache httpd to work as a forward proxy server. How can
I have an SVN repository that is configured to use Basic authentication through Apache
I have a simple NOOP file consumer configured in camel as follows: file:///tst?delay=10000&idempotent=false&include=fileMatch&noop=true Normally
I'm trying to integrate Google Places API using Apache Camel (2.10-SNAPSHOT) and Spring (3.0.7.RELEASE)
I have a windows service that picks up messages from various MSMQs. The service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.