Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while Using PickupService.py #1

Open
17YuvrajSehgal opened this issue Jun 30, 2024 · 0 comments
Open

Error while Using PickupService.py #1

17YuvrajSehgal opened this issue Jun 30, 2024 · 0 comments

Comments

@17YuvrajSehgal
Copy link

17YuvrajSehgal commented Jun 30, 2024

HTTPError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/suds/transport/http.py in send(self, request)
88 log.debug('sending:\n%s', request)
---> 89 fp = self.u2open(u2request, timeout=request.timeout)
90 self.getcookies(fp, u2request)

21 frames
HTTPError: HTTP Error 500: Internal Server Error

During handling of the above exception, another exception occurred:

TransportError Traceback (most recent call last)
TransportError: Internal Server Error

During handling of the above exception, another exception occurred:

WebFault Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/suds/client.py in process_reply(self, reply, status, description)
838 "as an internal server error.", status)
839 if self.options.faults:
--> 840 raise WebFault(fault, replyroot)
841 return http.client.INTERNAL_SERVER_ERROR, fault
842 if status != http.client.OK:

WebFault: Server raised fault: 'Authorization failed -- Service Operation is inactive.'

Code:

`def get_pickup_history():
url = "https://webservices.purolator.com/EWS/V1/PickUp/PickUpService.wsdl"
client = Client(url,username='key',password='pass')

# Create required SOAP headers
Language = client.factory.create('ns0:Language')
RequestContext = client.factory.create('ns0:RequestContext')
RequestContext.Version = '1.2'
RequestContext.GroupID = 'xxx'
RequestContext.RequestReference = 'Pickup Examples'
RequestContext.Language = Language.en

# RequestContext.UserToken = 'YourUserToken'
client.set_options(soapheaders=RequestContext)

#Set SOAP headers
PickUpHistorySearchCriteria = client.factory.create('ns0:PickUpHistorySearchCriteria')

PickUpHistorySearchCriteria.AccountNumber = "334740192201"
PickUpHistorySearchCriteria.ConfirmationNumber = "334740192201"
PickUpHistorySearchCriteria.FromDate = "2024-03-20"
PickUpHistorySearchCriteria.MaxNumOfRecords = 10
PickUpHistorySearchCriteria.ToDate = "2024-06-30"

return client.service.GetPickUpHistory(PickUpHistorySearchCriteria)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant