Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
fr33dz Regular Contributor.
Regular Contributor.
419 views

Create multiple SOAP Filter

Jump to solution

Hello,

I would like to apply multiple WS-I filters on NNMi  10.20 SOAP  ,  I  Use Zeep Python library :

from requests.auth import HTTPBasicAuth  # or HTTPDigestAuth, or OAuth1, etc.
from requests import Session
from zeep import Client
from zeep.transports import Transport

user = 'admin'
password = 'secret'
url = 'http://domaine.fr/NodeBeanService/NodeBean?wsdl'


session = Session()
session.auth = HTTPBasicAuth(user, password)
client = Client(url, transport=Transport(session=session))


node_id= "144077343434"

factory = client.type_factory('ns3')

constraint = factory.constraint(name="includeCustomAttributes", value=1)
condition = factory.condition(name="id", operator="EQ", value=node_id)
filterr = factory.expression(operator="AND", subFilters=[constraint, condition])

node_infos = client.service.getNodes(filterr)

I get this error

Fault: java.lang.IllegalArgumentException: prefix ns1 is not bound to a namespace

what is the solution please.

thanks in advance.

0 Likes
1 Solution

Accepted Solutions
fr33dz Regular Contributor.
Regular Contributor.

Re: Create multiple SOAP Filter

Jump to solution

Hello Vincent,

I found a solution using requests python library to post the XML request ,
and lxml library to parse the result :)
 

https://gist.github.com/fr33dz/bfdec8458d10df48177a2f248975f032

Regards,

Yacine BOUSLAHI

0 Likes
3 Replies
Vincent_M_NNM Acclaimed Contributor.
Acclaimed Contributor.

Re: Create multiple SOAP Filter

Jump to solution

Hello fr33dz

Thanks for posting,

That is a very intriguing request. I think this is beyond support scope, but maybe you can try to open a support request and see if they can assist you, but please take into account this may be out of their scope. Now i am not a python guy, but as far as I know when you get an error like this, the simplest way is to add the prefix declaration,

Regards,

 

Vincent Montenegro Mena
Customer Support Engineer

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.
0 Likes
fr33dz Regular Contributor.
Regular Contributor.

Re: Create multiple SOAP Filter

Jump to solution

Hello Vincent,

I found a solution using requests python library to post the XML request ,
and lxml library to parse the result :)
 

https://gist.github.com/fr33dz/bfdec8458d10df48177a2f248975f032

Regards,

Yacine BOUSLAHI

0 Likes
agiacomel
Visitor.

Re: Create multiple SOAP Filter

Jump to solution

Is there a solution using only the Zeep library?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.