KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Authenticating a Web Service Call
PRODUCT: 4D | VERSION: 2003 | PLATFORM: Mac & Win
Published On: August 5, 2004
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Web services in 4D provide an easy way for your application to serve, as well as connect to, SOAP services over HTTP. Often, SOAP services will simply allow clients to request information without any type of authentication whatsoever. However, there are some services that, in addition to using secure protocols, require that their connecting clients provide authorization.

The AUTHENTICATE WEB SERVICE command is a simple and easy-to-use command that will send an HTTP authentication header with the SOAP request.

For example:

AUTHENTICATE WEB SERVICE("myuser";"mypass")
CALL WEB SERVICE("https://my.domain.com/my_service";"MySoapAction";"https://my.namespace.com/";Web Service Dynamic)

will add the HTTP Authentication and Authorization headers to the HTTP request. Be careful not to confuse HTTP header with SOAP header, to which this command does not apply.