-------------------------------------------
Original Message:
Sent: Oct 01, 2025 12:36 PM
From: Sebastian Nagy
Subject: Service Desk SOAP API with python
Paulo,
It's my pleasure to try to help.
If you get an SID, and you get a response from the server, I don't think the issue is with the WSDL client or SSL certificates. In your python call, you get:
<?xml version="1.0" encoding="UTF-8"?><UDSObject> <Handle>cr:8838867</Handle> <Attributes> <Attribute DataType="2005"> <AttrName>status</AttrName> <AttrValue>ATD</AttrValue> </Attribute> </Attributes></UDSObject>
This tells me that you get a response and that the status was updated, BUT ensure you update the right ticket, check the status in the DB, maybe check the activity log, maybe the jsrvr and stdlog files,
Maybe enable logging on CXF by adjusting `NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\cxf\WEB-INF\classes\log4j2.xml`
Depending on what RU you have installed you might have:
<Logger name="com.broadcom.casm.sdm.jws.handlers.SOAPMessageHandler" additivity="false" level="DEBUG"> <AppenderRef ref="RollingFile" /></Logger>
commented out, enable or add this code, then restart tomcat, and monitor jsrvr.log - to see what incoming and outgoing XML.
If a call works with cURL, it should work from python code as well, the server doesn't really care who the client is, as long as it get's the right XML.
I wish you success in your troubleshooting.
Sebastian
Original Message:
Sent: Oct 01, 2025 10:12 AM
From: Paulo Ferraz
Subject: Service Desk SOAP API with python
Thanks a lot for your fast response, Sebastian!
I've changed the soapClient() to ignore TLS certificates from our endpoint as follows:
def soapClient(wsdl_url): """ Create a SOAP client using zeep library Args: str (WSDL endpoint URL) Returns: zeep.Client object """ try: # Personalized session session = Session() session.headers.update( {"Content-Type": "text/xml; charset=UTF-8", "SOAPAction": ""} ) session.verify = False urllib3.disable_warnings() # Zeep client with raw_response settings = Settings(raw_response=True) client = Client(wsdl_url, transport=Transport(session=session), settings=settings) except Exception as e: raise ConnectionError(f"Failed to create SOAP client: {str(e)}") return client
... but it not update that RDS at the Classic UI yet.
I discovered that our SDM customization is very complex and, then, it could impacting in your behavior.
I think this discussion can be closed now.
Original Message:
Sent: Sep 30, 2025 03:09 PM
From: Sebastian Nagy
Subject: Service Desk SOAP API with python
Hi Paulo,
I still don't know exactly what issue you are hitting, but I went ahead and created a POC using `zeep` as SOAP client and this is what worked for me, I could see in the Classic UI that the Status of the ticket changes, and the response gave me the right status back.
import zeepimport xmltodictdef soapClient(wsdl_url): """ Create a SOAP client using zeep library Args: str (WSDL endpoint URL) Returns: zeep.Client object """ try: client = zeep.Client(wsdl_url) return client except Exception as e: raise ConnectionError(f"Failed to create SOAP client: {str(e)}")def login_sdm(client): """Login to SDM service and return session ID""" request_data = { "username": "USERNAME", "password": "PASSWORD", } login_response = client.service.login(**request_data) print(f"Login: {login_response}") return login_responsedef logout_sdm(client, sid): """Logout from SDM service""" request_data = {"sid": sid} logout_response = client.service.logout(**request_data) print(f"Logout") return logout_responsedef update_status_rds(pidrds=None, rdstatus=None): """ Change RDS status Args: pidrds (str): RDS UID rdstatus (str): New RDS status Returns: dict: RDS handle, updated status, and HTTP status Possible RDS statuses: - Encaminhado = ENC - Em Atendimento = ATD - Em Aprovação = EMAPR - Em Homologação = HOMOLOG - Resolvido = RE - Cancelado """ SDM_ENDPOINT = "http://XXXX:8080/cxf/services/USD_WebService?wsdl" if pidrds is None or rdstatus is None: raise ValueError("Error: Missing RDS ID or status definition!") # Get SOAP client and login client = soapClient(SDM_ENDPOINT) sid = login_sdm(client) # Prepare request data request_data = { "sid": sid, "objectHandle": pidrds, "attrVals": {"string": ["status", rdstatus]}, "attributes": {"string": ["status"]}, } print(f"Request data: {request_data}") # Execute SOAP call try: response = client.service.updateObject(**request_data) except Exception as e: print(f"Error updating RDS status: {e}") raise # Parse XML response to extract handle try: parsed_xml = xmltodict.parse(response) handle = parsed_xml['UDSObject']['Handle'] # Extract AttrValue from the response status_attr = parsed_xml['UDSObject']['Attributes']['Attribute'] if isinstance(status_attr, list): # Multiple attributes - find the status one for attr in status_attr: if attr['AttrName'] == 'status': attr_value = attr['AttrValue'] break else: attr_value = None else: # Single attribute if status_attr['AttrName'] == 'status': attr_value = status_attr['AttrValue'] else: attr_value = None print(f"Extracted handle: {handle}") print(f"Extracted status AttrValue: {attr_value}") result = { "handle": handle, "updated": rdstatus, "status": 200, "response": response } except Exception as e: print(f"Error parsing XML response: {e}") result = { "handle": None, "updated": rdstatus, "status": 500, "error": f"XML parsing error: {str(e)}", "response": response } print(f"Return: {result['handle']}") logout_sdm(client, sid) return resultif __name__ == "__main__": # update_status_rds("cr:449051", "HOLD") update_status_rds("cr:449051", "OP")
The console output is:
Login: 338178029Request data: {'sid': 338178029, 'objectHandle': 'cr:449051', 'attrVals': {'string': ['status', 'OP']}, 'attributes': {'string': ['status']}}Extracted handle: cr:449051Extracted status AttrValue: OPReturn: cr:449051Logout