Right, The header I'm setting is not appearing when I check the response in
e.g. SoapUI. The only requirement I have is that I would like to see the
header in my response one way or the other :-)
I also have a System.out.println in my interceptor so I know it kicks in and
no exceptions are thrown so I wonder where the header went...
The response looks like this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Body>
      <ns1:getDatabaseFieldsResponse xmlns:ns1="http://some.namespace/";>
         <databaseFields>
          ...
         </databaseFields>
      </ns1:getDatabaseFieldsResponse>
   </soap:Body>
</soap:Envelope>


As you can see there's no headers available at all. Any ideas?


Ulhas Bhole wrote:
> 
> Hi Roland,
> 
> It's upto your requirement at which phase it should be added. I don't 
> see any problem in the way you are setting header. Do you mean to say 
> that interceptor kicks in but you don't see soap header other side?
> 
> Regards,
> 
> Ulhas Bhole
> 
> Ronald Pieterse wrote:
>> Hello,
>>
>> I'm trying to set a header in the SOAP response of all my calls.This
>> header
>> must just contain the version of my service implementation. I'm trying to
>> do
>> this using an OUT interceptor (extends AbstractSoapInterceptor) which is
>> defined in my spring file:
>>
>>
>>         <bean id="soapHeaderSetter"
>>              class="my.package.SoapHeaderSetter" />
>>
>>      <cxf:bus>
>>              <cxf:inInterceptors />
>>              <cxf:outInterceptors>
>>                      <ref bean="soapHeaderSetter" />
>>              </cxf:outInterceptors>
>>              <cxf:inFaultInterceptors />
>>      </cxf:bus>
>>
>>
>> The interceptor kicks in alright when I go back to the client but it's
>> unclear which Phase I need to be in to add the header and also how to set
>> the header. Do I just get the headers (btw there are no response headers
>> available - is that correct?) and then add one to the list like this:
>>
>>
>>         soapMsg.getHeaders().add(new Header(new
>> QName("http://some.namespace";), "api.version=1.7"));
>>
>>
>> I suspect that the way I set this header is not entirely correct :-) I
>> could
>> use some help here. THNX
>>
>>   
> 
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Setting-SOAP-header-in-SOAP-response-tf4697009.html#a13427417
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to