Log In    |    Knowledge Base    |    4D Home
Tech Tip: Sending a SOAP Header
Published On: December 6, 2004
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Sometimes, a SOAP service will require that their SOAP clients send specific information in a SOAP Header. In versions prior to 2004, in order to send a SOAP header, it was required that the ITK plugin was used. On top of that, you would have to build the entire SOAP request manually.

A new command in 2004, SET WEB SERVICE OPTION, and a special constant, Web Service SOAP Header, allows you to do all this without using the ITK.

Suppose you wanted the SOAP header portion of your SOAP request to contain the following XML:


Right before issuing a CALL WEB SERVICE command, you would have the following code:


The first parameter specifies which option we want to set, which is Web Service SOAP Header. The second specifies the XML document node we want to send with the request. In this example, we created a document node called "auth" and created child nodes "user" and "password."