06-13-2019 12:04 AM
Hi Guys,
I want to add, update, and remove FAC using AXL. I already got the syntax to add new FAC. The syntax is pretty much like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">
<soapenv:Header/>
<soapenv:Body>
<ns:addFacInfo sequence="?">
<facInfo>
<name>TEST</name>
<code>098765</code>
<authorizationLevel>40</authorizationLevel>
</facInfo>
</ns:addFacInfo>
</soapenv:Body>
</soapenv:Envelope>
But apparently it is not that simple to update or remove the FAC just by changing the addFacInfo to updateFacInfo and removeFacInfo respectively. Do you guys have an example script to update and remove FAC? Thank you.
Solved! Go to Solution.
06-21-2019 09:47 AM
You can use pretty much any language that can send XML over HTTP...
Here is the add and update XML from a test run of the sample:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Body> <ns0:addFacInfo xmlns:ns0="http://www.cisco.com/AXL/API/11.5"> <facInfo> <name>testFAC</name> <code>1234</code> <authorizationLevel>0</authorizationLevel> </facInfo> </ns0:addFacInfo> </soap-env:Body> </soap-env:Envelope>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Body> <ns0:updateFacInfo xmlns:ns0="http://www.cisco.com/AXL/API/11.5"> <name>testFAC</name> <newName>newTestFAC</newName> <code>5678</code> <authorizationLevel>1</authorizationLevel> </ns0:updateFacInfo> </soap-env:Body> </soap-env:Envelope>
06-13-2019 11:34 AM - edited 06-26-2019 07:48 AM
I was able to get this working in my 11.5 lab. Calling .updateFacInfo() looks a little different due to the xsdChoice for name vs. uuid, as you have to use the 'name' keyword, and then use keywords for the other elements at the same level in the XML document:
resp = service.updateFacInfo( name = 'testFAC', newName = 'newTestFAC', code = '5678', authorizationLevel = '0' )
I added the sample to the collection here, in case you are using Python, check it out: https://github.com/CiscoDevNet/axl-python-zeep-sample
06-14-2019 12:33 AM
Hi dstaudt,
Is it needed to be done on Python? Because I have no experience on it and currently debugging it using Postman.
And from your example, you wanted to change the name, right? What if I want to change the code or authorization level? Does the same approach will do the work?
Thank you.
06-21-2019 09:47 AM
You can use pretty much any language that can send XML over HTTP...
Here is the add and update XML from a test run of the sample:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Body> <ns0:addFacInfo xmlns:ns0="http://www.cisco.com/AXL/API/11.5"> <facInfo> <name>testFAC</name> <code>1234</code> <authorizationLevel>0</authorizationLevel> </facInfo> </ns0:addFacInfo> </soap-env:Body> </soap-env:Envelope>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Body> <ns0:updateFacInfo xmlns:ns0="http://www.cisco.com/AXL/API/11.5"> <name>testFAC</name> <newName>newTestFAC</newName> <code>5678</code> <authorizationLevel>1</authorizationLevel> </ns0:updateFacInfo> </soap-env:Body> </soap-env:Envelope>
06-23-2019 06:52 PM
Hi dstaudt,
That works perfect! There was only difference I noticed between my code and your code. I defined xmlns:ns="http://www.cisco.com/AXL/API/10.5", while you defined xmlns:ns0="http://www.cisco.com/AXL/API/11.5". Does that make make any difference from code perspective? I'm just curious how a little adjustment could make the code works.
06-26-2019 07:49 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide