@WebMethod
public String echo(String input)
{
try
{
SOAPMessageContext msgContext = (SOAPMessageContext)context.getMessageContext();
// log message
SOAPMessage soapMessage = msgContext.getMessage();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
soapMessage.writeTo(baos);
log.info(new String(baos.toByteArray()));
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
ReferenceParameters refParams = addrProps.getReferenceParameters();
for (Object refParam : refParams.getElements())
{
input += "|" + ((SOAPElement)refParam).getValue();
}