KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Checking the full SOAP Request
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: May 21, 2008
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

When running a 4D database as a SOAP client it can be beneficial to look at the Request you are sending to a SOAP server. This can be done with a packet sniffer, but a quick test can be achieved by setting up a simple 4D database as a SOAP server (you can run two instances of 4D on the same machine to do this) and send the SOAP request to that server.

To read the request simply put the following code in the SOAP server database's On web authentication database method:

C_TEXT($result)
If (Is SOAP request)
   GET HTTP BODY($result)
   CREATE RECORD([Table 1])
   [Table 1]Field1:=$result
   SAVE RECORD([Table 1])
End if



Note that Table 1's Field1 has to be a text variable to contain the SOAP request in this example. With this code a new record is created for each SOAP request and you can view each request separately. If your SOAP request is too large to fit in a text field you can use a BLOB instead and parse the BLOB to text.