For any server side Web Services development, logging the incoming requests is crucial. The following code snippet gives an example. Even though this particular example uses SOAPMessageContext from JAX-WS's SOAPHandler, the approach can be easily modified to fit into other Web Services solutions.
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
soapMessageContext.getMessage().writeTo(buffer);
log.info("SOAP Request:\n" + new String(buffer.toByteArray()));
Note that a lot of times logging comes hand in hand with incoming requests validation. Read this blog for more details.
Hi,
ReplyDeleteThis is the nice post and this post is really appreciable and informatics .I like this post too much.
Thanks a lot for sharing such a good source with all, i appreciate your efforts taken for the same. I found this worth sharing and must share this with all.
Authentication Certificate