KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Sending a SOAP Header
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: December 6, 2004

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:


 username
 password


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

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."