using https://www.freeformatter.com/xml-validator-xsd.html
If i take soapenf completely out of the mix here in the response and the schema, it works fine, but would like to do both.
(fyi i would like to point out this wsdl and xsd is not exposed on the endpoint, CISCO provides the zip file of the wsdl an xsd file) You then can send requests to the server per the wsdl/xsd and it will work. But the wsdl and xsd are not available on the cisco.com or the vm or domain you have the service installed)
This works perfectly in c# if i point to files, but i would like to load the xml document into NSXMLDocument variable document and have it point to its own schemaFile and just call validate
I have the following soap xml
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Body>
<ns:getCCMVersionResponse xmlns:ns="http://www.cisco.com/AXL/API/10.5"><return><componentVersion>
<version>10.5.2.11900(3)</version>
</componentVersion>
</return>
</ns:getCCMVersionResponse>
</soapenv:Body>
</soapenv:Envelope>
I took the bare minimum out of the xsd file that was provided by cisco and the online tool works with
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:axlapi="http://www.cisco.com/AXL/API/10.5"
attributeFormDefault="unqualified" elementFormDefault="unqualified"
targetNamespace="http://www.cisco.com/AXL/API/10.5" version="10.5">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/>
<xsd:complexType name="GetCCMVersionRes">
<xsd:complexContent>
<xsd:extension base="axlapi:APIResponse">
<xsd:sequence>
<xsd:element name="return">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="componentVersion">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="version" type="axlapi:String50"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="getCCMVersionResponse" type="axlapi:GetCCMVersionRes"/>
<xsd:simpleType name="String50">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType abstract="true" name="APIResponse">
<xsd:annotation>
<xsd:documentation>All responses must extend abstractResponse.</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="sequence" type="xsd:unsignedLong" use="optional"/>
</xsd:complexType>
</xsd:schema>
Please note i had to add below to the xsd file for it to get past a SOAP error
<xsd:import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/>
And it works in the online tool
Now this is great and all for an online tool, but i would like to verify the document itself. This is done (if you read the online tool), by adding to the Soap request envelope element "noNamespaceSchemaLocation" or "schemaLocation" and a http path to the xsd file (or the partial file i created above)
I have tried all sorts of ways using the online tool, and it would never validate. its currently hosted at http://test123a.epizy.com/getCCMVersion.xsd (i hope its not because its a free host that im having a problem), but there should also be ways to accomplish this using file:///
I am using macOS, and objective-c, but all the code is doing, is manipulating the soap xml response header, and putting the location of file:///. I have also tried http:// as well.
Can anyone solve this absolute mystery? It seems so plain and simple from some of the examples online....
Validate XML Schema with xsd file in Cocoa?
http://answerqueen.com/2j/q7vz0zv32j
How to fix soapenv:Envelope issue in XSD schema while validating with SOAP request/response
https://code.i-harness.com/en/q/8bfd7
How to reference a local XML Schema file correctly?
Cvc-elt.1: Cannot Find The Declaration Of Element 'soap:Envelope'
Thank you for your help in advance
this guy never got an answer SOAP Response Schema Validation