VMware {code} Community
smm342
Contributor
Contributor

Error when attempting to revertToCurrentSnapshot

I am attempting to use the "Revert To Current Snapshot" functionality in the REST API and I am failing.

The documentation says that you send a POST request with no body to this URL (replacing the base URL as appropriate):

This is what I am getting back.

Status code : 500 Method failed: HTTP/1.1 500 Internal Server Error
status code: 500
response: <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server</faultcode>
            <faultstring>Error in assertion processing</faultstring>
            <detail>
                <l7:policyResult status="null content type header value" xmlns:l7="http://www.layer7tech.com/ws/policy/fault"/>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>
I have been setting my content type to blank since there is no body... the documentation says nothing about setting the content type for this call. What am I doing wrong?

0 Kudos
2 Replies
smm342
Contributor
Contributor

This seems to happen with any API call I make that has a POST and no body.

0 Kudos
smm342
Contributor
Contributor

Well apparently you have to specify a body and content type despite it saying you don't. So this works:

content type: application/xml

Body: <?xml version="1.0" encoding="UTF-8"?> <Foobar></Foobar>

This is definitely a bug in the API.

You have to have a content type specified that has a slash in it ("application/xml" without quotes works fine). You also have to have a valid XML body.

0 Kudos