Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

SOAP and Web Services in AdvPL

Organizes contract, generated client and headers for SOAP integration.

SOAP and Web Services in AdvPLAdvPL
01 · OVERVIEW

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

03 · PRACTICAL EXAMPLE

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)
Expected result

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.

BEST PRACTICES
  • 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.

Related content

REFERENCES
  1. TOTVS. WSCLIENT. Geração pelo TDS. Accessed on 2026-10-28.
  2. TOTVS. WSMETHOD. Accessed on 2026-10-28.
  3. TOTVS. Classe WSCLIENT para SOAP: passar autenticação. Artigo consultado. Accessed on 2026-10-28.
  4. TOTVS. RpcSetEnv: ambientes de serviços. Accessed on 2026-10-28.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha