Initialized exchange contains message. In your case sendOut contains message
sent from Http endpoint to browser or software client (to service caller). If
you wish set message property sent from http endpoint to nmr you should use
MessageExchange.getMessage("in") and set properties on it.
Regards,
Lukasz
> Hi Lukasz,
>
> thanks for the hint. I already did the first part (endpoint configuration)
> the way you described it, however the implementation is still the problem. I
> don't want to set properties of the exchange, I want to set properties of the
> normalized message that is dispatched via this marshaler. How can I achieve
> this?
>
> I also tried the following which doesn't work either:
>
> public class MyHttpSoapConsumerMarshaler extends HttpSoapConsumerMarshaler {
> public void sendOut(MessageExchange ex, NormalizedMessage nMsg,
> HttpServletRequest request, HttpServletResponse response) throws Exception {
> nMsg.setProperty("a", "b");
> super.sendOut(ex, nMsg, request, response);
> }
> }
>
> Thanks,
> Stefan
>
>
> Am 04.10.2011 um 20:06 schrieb Łukasz Dywicki:
>
>> Hey Stefan,
>> You don't have to modify HttpSoapConsumerMarshaler, you may extend this
>> class and reffer it instance using endpoint configuration:
>> <bean id="my-bean-id" class="org.example.soap.MyMarshaler" />
>>
>> <http:consumer service="..." marshaler="#my-bean-id" />
>>
>> Your instance will be responsible for creating new exchanges. Example
>> implementation:
>>
>> class MyMarshaler extends HttpSoapConsumerMashaler {
>> public MessageExchange createExchange(HttpServletRequest request,
>> ComponentContext context) throws Exception {
>> MessageExchange ex = super.createExchange(request, context);
>> ex.setProperty("a", "b"); // that's magic
>> return ex;
>> }
>> }
>>
>> Best regards,
>> Lukasz
>>
>>> Hi everybody,
>>>
>>> I'm trying to modify the HttpSoapConsumerMarshaler to embed some of my SOAP
>>> headers of an incoming SOAP message as Message Properties into the
>>> Normalized Message dispatched to the NMR. However I just can't figure out
>>> how. I found out that the unmodified HttpSoapConsumerMarshaler embeds one
>>> property into the Normalized Message that is itself a map of properties
>>> originally associated with the SOAP message. But how can I set some of
>>> these as single Message Properties without the map in between?
>>>
>>> Thanks,
>>> Stefan
>>
>