Php: Soap: Element Envelope: No matching global declaration available for the validation root
From FVue
Contents
Problem
Validating a SOAP request with an XML Schema file gives the error message:
Element '{http://schemas.xmlsoap.org/soap/envelope/}Envelope': No matching global declaration available for the validation root.
Environment
- php-5.3.10
Solution
The XML Schema file is missing the `Envelope' definition. Import the `Envelope' definition like this:
<import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/>
Or you can download the schema-definition locally, e.g. "soap-envelope.xsd", and import the local file:
<import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="soap-envelope.xsd"/>
If you get this error:
Element '{http://www.w3.org/2001/XMLSchema}schema The content is not valid. Expected is ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*).' (length=241)
make sure the `import' is done within the `XMLSchema' namespace.
Advertisement