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.2.tar.gz (82.0 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.2-py3-none-any.whl (307.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gwsoap-1.0.2.tar.gz
  • Upload date:
  • Size: 82.0 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.2.tar.gz
Algorithm Hash digest
SHA256 5ab32913ed86c413a04f09fd246bd744810222e2ba768688e61e12f5def63b6d
MD5 cdf7ab5c3f665ceeb8be525ec643539f
BLAKE2b-256 a87aada21ee115d520b41ac7ccf16f9f716a1f8b3d9fee161e8c44e3f3b8c3aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gwsoap-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 307.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec33380eb1b2e53618ef9303b45512b11b6f3853d52cee2cca709d7f34f8f024
MD5 40b0dd6c4b09658cede3f50860b59b2d
BLAKE2b-256 ffe8b588cc655121bcf765bbb2fa380dbf02c506e9c18144915bda7ced90ffce

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