Popeye
Popeye

Reputation: 1558

Mismatch in Namespaces in xml and xsd

I have a xsd file for a service in which the namespace is defined on top level as -

<xs:schema 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
targetNamespace= "http://www.ycompany.net/" 
xmlns="http://www.ycompany.net/" 
elementFormDefault="qualified">

And then there are no namespaces in the whole xsd.

But if I see the XML response of this service, the names of the parameters are correct but there are whole different namespace on each and every element. e.g.

<a:getScooterListResponse xmlns:a="http://com/ngr/pumba/vip/service/ycompany/grammars/pclst" xmlns:b="java:ycompany.grammars.pclst.structures.messages" xmlns:c="java:ycompany.grammars.pclst.structures.groups" xmlns:d="java:ycompany.grammars.pclst.structures.segments" xmlns:e="java:ycompany.grammars.pclst.structures.composites" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <a:return>
        <b:OrFiltersQuery>
            <c:Dummy>
                <d:DummyByte>0</d:DummyByte>
            </c:Dummy>
            <c:AndFiltersQuery>
                <c:ScooterListFilterName>
                    <d:AttributeDetails>
                        <e:AttributeType>FQA</e:AttributeType>
                    </d:AttributeDetails>
                </c:ScooterListFilterName>
            </c:AndFiltersQuery>
        </b:OrFiltersQuery>
.
.
.

My question is that is it somehow possible to have different namespaces in xsd and actual response or is this xml for a different xsd?

Upvotes: 0

Views: 289

Answers (1)

Michael Kay
Michael Kay

Reputation: 163262

You haven't shown us the whole of the schema (the schema document may import other schema documents for different namespaces), but judging from what you have shown us, this is not the right schema for this instance document.

Upvotes: 1

Related Questions