SOAP and Web Services in AdvPL
Organizes contract, generated client and headers for SOAP integration.
Overview
Start with the WSDL and TDS-generated client: WSCLIENT documentation directs its use for this generation with TOTVSWebSrv.ch. WSMETHOD declares client/server methods; SOAP and REST contracts differ. The authentication article documents _HEADOUT for HTTP headers. This subset only prepares a header on an existing generated object, without building credentials, sending requests or logging secrets. Define endpoint, TLS, timeout and failure policy in the integration contract. Do not reopen company context with RpcSetEnv when the framework owns the service environment; documentation adds a restriction from 12.1.2510. (Sources: refs. 1–4.)
Commented example
// Fragment: WSDL-generated oClient; cAuthHeader obtained from protected storage.
// Never log the header; this subset makes no network call.
If oClient:_HEADOUT == Nil
oClient:_HEADOUT := {}
EndIf
AAdd(oClient:_HEADOUT,cAuthHeader)Adds a complete HTTP header to the existing client without invoking SOAP. Avoid duplicate Authorization headers when reusing clients. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Base64 does not encrypt credentials. Use validated HTTPS and least privilege; handle faults, outages and retries without duplicate effects.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.