Skip to main content

Auto-generated Python client for the GroupWise SOAP API

Project description

GroupWise Python Client

Auto-generated Python package for the GroupWise WSDL/XSD schemas.

Generation code: https://github.com/rhulha/GWSoapApiClientGenerator

Usage

import sys
import config
from gwsoap.service.groupwise_client import GroupWiseClient
from gwsoap.methods.LoginRequest import LoginRequest
from gwsoap.methods.LogoutRequest import LogoutRequest
from gwsoap.methods.GetFolderListRequest import GetFolderListRequest
from gwsoap.methods.GetItemsRequest import GetItemsRequest
from gwsoap.types.PlainText import PlainText
from gwsoap.soap.request_context import RequestContext
from gwsoap.soap.exceptions import SoapFaultException

try:
    client = GroupWiseClient(config.GW_SOAP_URL)

    print(f"Connecting to {config.GW_SOAP_URL} as {config.GW_USER} …")
    login_req = LoginRequest(
        auth=PlainText(username=config.GW_USER, password=config.GW_PASSWORD),
        application="GWSoapDemo",
        language="en",
    )
    login_resp = client.login(login_req)

    session = login_resp.session
    print(f"  Version : {login_resp.gw_version}  build {login_resp.build}")
    if login_resp.userinfo:
        ui = login_resp.userinfo
        print(f"  user.name    : {ui.name}")
        print(f"  user.email    : {ui.email}")
        print(f"  user.uuid    : {ui.uuid}")
        print(f"  user.recip_type    : {ui.recip_type}")
        

    ctx = RequestContext(session_id=session)

    print("\nTop-level folders:")
    folder_resp = client.get_folder_list(GetFolderListRequest(parent="folders", recurse=False), ctx)
    folders = folder_resp.folders.folder if folder_resp.folders else []
    if folders:
        for f in folders:
            fid   = f.id
            fname = f.name or f.display_name
            ftype = type(f).__name__
            print(f"  [{ftype}]  {fname}  (id={fid})")

    print("\nFirst 10 items in mailbox:")
    items_resp = client.get_items(GetItemsRequest(container="mailbox", count=10), ctx)
    items = items_resp.items.item if items_resp.items else []
    if items:
        for item in items:
            iid      = item.id
            subject  = item.subject
            itype    = type(item).__name__
            print(f"  [{itype}] {subject!r}  id={iid}")

    client.logout(LogoutRequest(), ctx)
    print("Done.")

except SoapFaultException as e:
    print(f"SOAP Fault: {e.faultcode} - {e.faultstring}")
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwsoap-1.0.3.tar.gz (82.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gwsoap-1.0.3-py3-none-any.whl (307.8 kB view details)

Uploaded Python 3

File details

Details for the file gwsoap-1.0.3.tar.gz.

File metadata

  • Download URL: gwsoap-1.0.3.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for gwsoap-1.0.3.tar.gz
Algorithm Hash digest
SHA256 d417a2238562c0103fbefab9430800316616f28971534fcfa76dd265fb3f4d63
MD5 25f8f2b56fb0c08d0ad374250a56462d
BLAKE2b-256 92226822042bc8821f9de4f28bc5a6f6854354508f9dfca441cb6f729c37f587

See more details on using hashes here.

File details

Details for the file gwsoap-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: gwsoap-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 307.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for gwsoap-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a2afae63281effc638b93e8dbe3b380d11b78f94bd50466fd13ec4b2a7b9887d
MD5 530d2377046eed42437b0bdeb08b4ce4
BLAKE2b-256 1f85d2f43751baff534ace1c97bf6fe3c1f54cb2aace4f6aa7797f42d14c8b46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page