jeudi 24 octobre 2019

Trouble with web service types using Python and suds

I´m trying to create a program that sends information to a WebService using Python with SUDS. I have the wsdl, the problema it that i can not show, it is private but this is my question:

in the wsdl there is a method (Create_Incident)

Create_Incident(xs:string Action, xs:string Summary, xs:string Notes,
 Incident_TypeType Incident_Type, Reported_SourceType Reported_Source,
 ImpactType Impact, UrgencyType Urgency, Incident_StatusType Status,
 Incident_Status_ReasonType Status_Reason, xs:string Customer_FirstName,
 xs:string Customer_LastName, xs:string Customer_MiddleInitial,
 xs:string Customer_CorporateID, xs:string Customer_Company, xs:string Customer_LoginID, xs:string Person_InstanceID, xs:string…)

I have troble with Incident_Type, Reported_SourceType, ImpactType, because those are complex types.

Incident = client.factory.create('Incident_TypeType')
print(Incident)

Reporte = client.factory.create('Reported_SourceType')
print(Reporte)

Impacto = client.factory.create('ImpactType')
print(Impacto)

Urgencia = client.factory.create('UrgencyType')
print(Urgencia)

It shows this:

(Incident_TypeType){
   User Service Restoration = "User Service Restoration"
   User Service Request = "User Service Request"
   Infrastructure Restoration = "Infrastructure Restoration"
   Infrastructure Event = "Infrastructure Event"
 }
(Reported_SourceType){
   Direct Input = "Direct Input"
   Email = "Email"
   External Escalation = "External Escalation"
   Fax = "Fax"
   Self Service = "Self Service"
   Systems Management = "Systems Management"
   Phone = "Phone"
   Voice Mail = "Voice Mail"
   Walk In = "Walk In"
   Web = "Web"
   Other = "Other"
   BMC Impact Manager Event = "BMC Impact Manager Event"
 }
(ImpactType){
   1-Extensive/Widespread = "1-Extensive/Widespread"
   2-Significant/Large = "2-Significant/Large"
   3-Moderate/Limited = "3-Moderate/Limited"
   4-Minor/Localized = "4-Minor/Localized"
 }
(UrgencyType){
   1-Critical = "1-Critical"
   2-High = "2-High"
   3-Medium = "3-Medium"
   4-Low = "4-Low"
 }

Can someone help me on how to fill this correctly please

Thanks a lot : )




Aucun commentaire:

Enregistrer un commentaire