Skip to content

Python SOAP API wrapper for Planon using Zeep and Requests

License

Notifications You must be signed in to change notification settings

planon-community/libplanon-soap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USAGE

This Python package uses PyPi packages requests and zeep to interact with the Planon SOAP API.

SETUP

The SOAP methods available are heavily based on what the Planon BO supports, some BOMs are not supported in SOAP out of the box. The SOAP API must be configured, the Java code generated and compiled, and then the results jar deployed to the Planon Axis2 service. For more information on configuring web services see Planon's web services documentation.

python -m venv venv
source venv/bin/activate
pip install ./libplanon

INITIALIZATION

soap_url = "{{PLANON_FQDN}}/nyx/services"
user = "USER"
pwd = "PWD"

get_token = libplanon.TokenManager(url=soap_url, username=user, password=pwd, reference_date=None).get_token

pln_client = libplanon.APIManager(url=soap_url, services=['AccountGroup', 'Account', 'Person'])
pln_account_client = pln_client['Account']
pln_group_client = pln_client['AccountGroup']
pln_person_client = pln_client['Person']

QUERY

code = "ABC123"

# Find by filter
group_ids = pln_group_client.find(get_token(), {
        'fieldFilters': [{
            'fieldName': 'Code',
            'filterValue': code,
            'operator': 'equals'
            }]
    })

# Find all
group_ids = pln_group_client.find(get_token(), {})

READ

groups = []
for group_id in group_ids:
     groups.append(pln_group_client.read(get_token(), group_id))

UPDATE

group = groups[0]

group['Name'] = "Hello World!"
pln_group_client.save(get_token(), group))

About

Python SOAP API wrapper for Planon using Zeep and Requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages