return cookie.toString();
}
public boolean handleResponse(MessageContext msgContext)
{
SOAPMessageContext smc = (SOAPMessageContext)msgContext;
SOAPMessage message = smc.getMessage();
// Legacy JBossWS native approach
MimeHeaders mimeHeaders = message.getMimeHeaders();
String[] cookieValues = mimeHeaders.getHeader(CookieUtil.SET_COOKIE);
// proper approach through MessageContext.HTTP_RESPONSE_HEADERS
if (cookieValues == null)
{
@SuppressWarnings("unchecked")
Map<String, List<String>> httpHeaders = (Map<String, List<String>>)smc.get(MessageContext.HTTP_RESPONSE_HEADERS);
List<String> l = httpHeaders.get(CookieUtil.SET_COOKIE);
if (l != null && !l.isEmpty())
{
cookieValues = l.toArray(new String[l.size()]);
}