login = LoginRequest()
login.client_id = 1000000
login.org_id = 5000003
login.role_id = 1000000
login.warehouse_id = 5000007
login.password = '******'
login.user = '******'

query = QueryDataRequest()
query.web_service_type = 'QueryImageTest'
query.offset = 5
query.limit = 1
query.login = login

wsc = WebServiceConnection()
wsc.url = url
wsc.attempts = 3
wsc.app_name = 'Test from python'

try:
    response = wsc.send_request(query)
    wsc.print_xml_request()
    wsc.print_xml_response()

    if response.status == WebServiceResponseStatus.Error:
        print('Error: ', response.error_message)
    else:
        print('Total Rows: ', str(response.total_rows))
        print('Num rows: ', str(response.num_rows))
        print('Start row: ', str(response.start_row))
Beispiel #2
0
"""

"""
Contributor: @pozzisan <*****@*****.**>
"""

from brerpwsc.net import WebServiceConnection

url = 'http://teste.brerp.com.br/ADInterface/services/ModelADService'
urls = 'https://localhost:8431/ADInterface/services/ModelADService'


def test_xml():
    test_file = open('../documents/ReadBPartnerTest_request.xml', 'r')
    return test_file.read()


wsc = WebServiceConnection()
wsc.url = url
wsc.attempts = 3
try:
    response = wsc.send_request(test_xml())
except Exception as e:
    print('Error', str(e))
else:
    wsc.print_xml_response()
finally:
    print(wsc.attempts_request)
    print(wsc.time_request)
    print(wsc.response_status)