How Do I ... : Web Services Tips, Hints and FAQs : How can I print incoming and outgoing SOAP messages on my Web services client?
How can I print incoming and outgoing SOAP messages on my Web services client?
The message handler chain can be modified to add code that dumps the contents of the SOAP message and response.
| factory pluggableHandler |
factory := ( SstWSContainer containerNamed: 'VastSampleClientContainer' ) handlerFactory.
pluggableHandler :=SstWSPluggableHandler new
invokeBlock: [ :anSstWSMessageContext | | message |
[
message := anSstWSMessageContext propertyNamed: ##wsTransportMessageRequest.
AbtXmlUtility logError: 'Request->'.
AbtXmlUtility logError: message asString.
AbtXmlUtility logError: ''.
AbtXmlUtility logError: 'Response->'.
" NOTE: The output message is not stored in the message context. "
message := anSstWSMessageContext propertyNamed: ##wsTransportMessageResponse.
AbtXmlUtility logError: message header debugPrintString.
btXmlUtility logError: message contents asString ] fork
].
factory
register: pluggableHandler
named: 'wsHttpClientResponseHandler' inNamespace: factory globalNamespace
 
To disable the tracing code, execute the snippet below:
| factory |
factory := ( SstWSContainer containerNamed: 'VastSampleClientContainer' ) handlerFactory.
factory
register: SstWSNoOperationHandler default
named: 'wsHttpClientResponseHandler' inNamespace: factory globalNamespace
-------------------------------
Last modified date: 04/08/2023