I’ve been using the SOAP API, specifically a call to the GetRelevanceResult method with a custom session relevance query, and its been working for a customer running 9.x of BigFix with no problems. They have recently upgraded to BigFix 9.5.2.56 and have now started getting an error:
Error in deserializing body of reply message for operation 'GetRelevanceResult'
There is an error in XML document (6060, 3712).
The session relevance query is pretty simple, returning data:
(name of computer of it | "" & ":" & concatenation "~" of values of it) of results of properties of BES Fixlets whose (analysis flag of it and name of it = "Custom Software Inventory")
For each device, where there may be zero or more instances of ‘Vendor;Product;Version’. I’ve updated to the same version in my small test lab, and it works fine for me, which makes me think its an issue with the data?
I’ve exported the data output from the session relevance query, and for some vendors the data has the value:
<no manufacturer>
Could it be that this is interfering with the XML format the the SOAP API is using to transfer the results? How would I remove these values in the session relevance query?
(name of computer of it | "" & ":" & concatenation "~" of values of it) of results of properties of BES Fixlets whose (analysis flag of it and name of it = "Custom Software Inventory")
value, or all instances of ‘<’ and ‘>’. As the individual items are a list of values, and I concatenate them into a single value per PC, this is potentially more challenging…
Does anyone know how I can change my session relevance query to strip out these values?
Did they upgrade from a 9.5 version or a 9.2 version before this appeared? I’d recommend opening a PMR, but just for background info, the new Unicode functionality introduced in 9.5 has caused problems with several string inspectors in my environment (at this point, all resolved after opening PMRs).
Sounds like there may be a problem with escaping the brackets in the XML response.
One possibility might be to insert the escapes of the characters in the result - “<” is 3c and “>” is 3e in the ASCII hexadecimal table -
(concatenation "<" of substrings separated by "%3c" of concatenation ">" of substrings separated by "%3e" of it) of (name of computer of it | "" & ":" & concatenation "~" of values of it) of results of properties of BES Fixlets whose (analysis flag of it and name of it = "Custom Software Inventory")
Yes, the customer upgraded from 9.2 to 9.5, and this is when the issue appeared, but it could also be a coincidence, and may have just started collecting data with the at a similar time. But yes, I would have expected that BigFix would have automatically escaped the data to make it safe for the XML response.
I’m not sure of the process of raising a PMR, is it simple to do, where do I start?
@JasonWalker thank you, this looks like it will be a suitable initial workaround. I was unsure of how to do the replacement of these values, but the example you included is nice and simple (which makes a nice change for SRQ!)
I beleive the replacement values should be:
<
>
I presume there was no reason to leave off the semicolon in your example, just an oversight?
I’ve sent the changes to the customer, and will report back if this workaround addresses the issue.
Unfortunately, the updated session relevance query which encodes the < and > characters did not address the issue, and the SOAP API is still failing with the same error message, suggesting that it may be a more integral issue with the API.
You should try the % escape sequence instead of <
a " character is %22 in the relevance escape sequence. In some cases you have to layer the escaping to make it %2522 which is the escape of the % character, then the 22.
My guess is that either % escaping or a layered escaping is required for what you are trying to do to work. It may even be that < is correct, but that you have to escape the & character in some fashion first.