return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
}
@Override
protected Packet getResponse(Packet request, @Nullable SOAPMessage returnValue, WSDLPort port, WSBinding binding) {
Packet response = super.getResponse(request, returnValue, port, binding);
// Populate SOAPMessage's transport headers
if (returnValue != null && response.supports(Packet.OUTBOUND_TRANSPORT_HEADERS)) {
MimeHeaders hdrs = returnValue.getMimeHeaders();
Map<String, List<String>> headers = new HashMap<String, List<String>>();
Iterator i = hdrs.getAllHeaders();
while(i.hasNext()) {
MimeHeader header = (MimeHeader)i.next();
if(header.getName().equalsIgnoreCase("SOAPAction"))
// SAAJ sets this header automatically, but it interferes with the correct operation of JAX-WS.
// so ignore this header.
continue;
List<String> list = headers.get(header.getName());
if (list == null) {
list = new ArrayList<String>();
headers.put(header.getName(), list);
}
list.add(header.getValue());
}
response.put(Packet.OUTBOUND_TRANSPORT_HEADERS, headers);
}
return response;
}