Web Services Guide : Cookbook : Debugging Tips
Debugging Tips
 
These tips are intended to point out useful places to set breakpoints, and code to execute that can enable or disable exception handlers that may assist with finding problems in web service message processing and XML parsing.
 
When using the Cookbook’s Examples, the breakpoints discussed can be set to further investigate how the processing works.
 
Turning Off Exception Handling and Forwarding
 
The web services framework uses the SST framework for message transport. http (or https) exception handling should be turned off to allow stopping at certain points in web service processing.
To turn off exception trapping and forwarding for http, choose Tools>SST>>Trap Exceptions from the Transcript pulldowns. In the resulting dialog, move http from the enabled to the disabled list. Repeat for Tools>SST>>Forward Exceptions.
Inspect Request/Response SOAP Envelopes during Client Web Service Invocation
The methods of interest are SstWSHttpDispatchHandler>>postSOAPMessage:to:context: and SstWSHttpDispatchHandler>>invoke:.
If you set a breakpoint in the invoke: method and step into postSOAPMessage:to:context:, the parameter aString contains the string representation of the SOAP request envelope. Alternatively you can inspect the expression: self contentsFrom: aMessageContext to see the request envelope. If you step over postSOAPMessage:to:context:, result will contain the response SOAP Envelope in its byteArray instance variable.
It is possible to modify aString to change the SOAP request before sending, and possible to change the response SOAP envelope that comes back before deserialization by stopping in this method.
Inspect Request/Response SOAP Envelopes during Server Request/Response Processing
The method of interest is SstHttpServletRequest>>basicProcessRequest:. Set the breakpoint at the line:
responseContent := (self servletManagerAt: servletRequest getContextPath) service: servletRequest.
The request SOAP Envelope maybe seen by inspecting the contents of the servlet request parameter.
Step over the expression and inspect the responseContent to see the response SOAP Envelope. If you step into the expression, you will begin to traverse message processing, including invocation of the various handlers along the way.
Enable signaling of Mapping Parser Exceptions
The following expression
AbtXmlMappingError enableExceptionSignal: true
can assist in finding errors in XML data, map or schema processing.
 
Reset the Web Services Development Environment
Execute SstWSContainer’s class side method resetWebServicesDevelopmentEnvironment to clean up the development environment when debugging web services. The method can be useful in several scenarios such as a failed deployment or a failed deserialization attempt.
In both these cases, schemas can be left in several caches which should be removed so that any modifications made to them will take effect during the next test. Schemas are cached in lookup tables with the namespace as a key. If you update a schema and its namespace exists in these caches as a key, the schema will not be updated or re-imported.
The method also clears all containers from SstWSContainer's cache and resets the secure socket registry.
Last modified date: 08/16/2019