AnsweredAssumed Answered

API from command line give invalid XML error

Question asked by wkolatac on Feb 25, 2018
Latest reply on Feb 28, 2018 by wkolatac

Hi -

I'm running the following command from the Windows command line:

curl -u "<user:password>" -H "content-type: text/xml" --data-binary -@ -k https://qualysapi.qualys.com/qps/rest/3.0/search/was/report < .\file.xml

 

The response message is:
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://qualysapi.qualys.com/qps/xsd/3.0/was/report.xsd">
<responseCode>INVALID_XML</responseCode>
<responseErrorDetails>
<errorMessage>Invalid XML format: Content is not allowed in prolog.</errorMessage>
</responseErrorDetails>
</ServiceResponse>

 

The file.xml contains a very simple request filter (see attachment).

 

Any idea what is wrong?  I've checked the file.xml many times and doesn't appear to be any hidden characters before the <ServiceRequest> tag ....

 

I've even tried just the beginning/end Service Request tag with different API calls and get the same result so I'm wondering if the error message is correct...

Any help is appreciated.

Attachments

Outcomes