1. src-import.3.1: ...

You provided 2 location hints for the namespace "http://foo/TruckTrace";,
one through xsi:schemaLocation with the value "TruckTrace.xsd"; one through
<import>, with the value "TruckTraceSoap.xsd". The parser is free to pick
whichever one. Xerces decides to use "TruckTrace.xsd". But this schema has
target namespace "http://schemas.xmlsoap.org/soap/envelope/";, which is why
the error is reported.

To fix it, change xsi:schemaLocation so that the uri pairs match; or change
the external schema location property to include locations for both
namespaces. (This property has precedence over other location hints from
the instance or the schema.)

2. cvc-elt.1: ...

Now there is no location hint for the namespace "
http://schemas.xmlsoap.org/soap/envelope/";, so the parser can't find a
declaration for the root element.

HTH,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                
                                                           
                      "Th�bault, M�d�rick"                                      
                                                           
                      <[EMAIL PROTECTED]        To:       <[EMAIL PROTECTED]>   
                                      
                      ferries.fr>                         cc:                   
                                                           
                                                          Subject:  Xerces 2.x  
                                                           
                      02/12/2003 01:09 PM                                       
                                                           
                      Please respond to                                         
                                                           
                      xerces-j-user                                             
                                                           
                                                                                
                                                           
                                                                                
                                                           



Hello

Here are the schema that I try to use.

TruckTrace.xsd, TruckTraceSoap.xsd, TruckTraceRequest.xsd,
TruckTraceResponse.xsd.

TruckTrace.xsd

<xs:schema targetNamespace="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:response="http://foo/TruckTrace";
xmlns:request="http://foo/TruckTrace"; elementFormDefault="qualified"
attributeFormDefault="qualified">
             <!-- <xs:import namespace="http://foo/TruckTrace";
schemaLocation="TruckTraceRequest.xsd"/>
 <xs:import namespace="
http://foo/TruckTrace";
schemaLocation="TruckTraceResponse.xsd"/> -->
             <xs:import namespace="http://foo/TruckTrace";
schemaLocation="TruckTraceSoap.xsd"/>
             <xs:element name="Envelope">
                         <xs:complexType>
                                     <xs:sequence>
                                                 <xs:element name="Header"
type="SOAP-ENV:HeaderType" form="qualified" minOccurs="0"/>
                                                 <xs:element name="Body"
form="qualified">

<xs:complexType>

<xs:choice>

       <xs:element
ref="request:truckEnqui"/>

       <xs:element
ref="response:truckResponse"/>

       <xs:element
name="Fault" type="SOAP-ENV:FaultType"/>

</xs:choice>

</xs:complexType>
                                                 </xs:element>
                                     </xs:sequence>
                                     <xs:attribute name="encodingStyle"
use="optional" fixed="http://schemas.xmlsoap.org/soap/encoding/"/>
                         </xs:complexType>
             </xs:element>
             <xs:complexType name="HeaderType">
                         <xs:sequence>
                                     <xs:any namespace="##other"
processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                         </xs:sequence>
                         <xs:anyAttribute namespace="##other"
processContents="lax"/>
             </xs:complexType>
             <xs:complexType name="FaultType">
                         <xs:sequence>
                                     <xs:element name="faultcode" type
="xs:QName"/>
                                     <xs:element name="faultstring"
type="xs:string"/>
                                     <xs:element name="faultfactor" type
="xs:anyURI"
minOccurs="0"/>
                                     <xs:element name="detail" minOccurs
="0">
                                                 <xs:complexType>
                                                             <xs:sequence>

<xs:any
namespace="##any" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
                                                             </xs:sequence>

<xs:anyAttribute
namespace="##any" processContents="lax"/>
                                                 </xs:complexType>
                                     </xs:element>
                         </xs:sequence>
             </xs:complexType>
</xs:schema>

TruckTraceSoap.xsd

<xs:schema targetNamespace="http://foo/TruckTrace";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
             <xs:include schemaLocation="TruckTraceRequest.xsd"/>
             <xs:include schemaLocation="TruckTraceResponse.xsd"/>
</xs:schema>

TruckTraceRequest.xsd

<xs:schema targetNamespace="http://foo/TruckTrace";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns="http://foo/TruckTrace"; elementFormDefault="unqualified"
attributeFormDefault="unqualified">
             <xs:element name="truckEnqui" type="TruckEnquiType"/>
             ........................
</xs:schema>


Here is the value for my parser property
"http://apache.org/xml/properties/schema/external-schemaLocation";

Object value = "http://schemas.xmlsoap.org/soap/envelope/ "+ directory
+"TruckTrace.xsd";

When receiving request like the following, all is OK for my parser :

<soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding";>
             <soap-env:Body>
                         <ns0:truckEnqui xmlns:ns0="http://foo/TruckTrace";>

<sClientAccountNo>F101012E</sClientAccountNo>

<dDepartureDate>2003-02-12T00:00:00</dDepartureDate>

<sSearchWithinFiveDays>Y</sSearchWithinFiveDays>
                                     <sRoute/>
                                     <sRegistrationNo/>
                         </ns0:truckEnqui>
             </soap-env:Body>
</soap-env:Envelope>

but maybe not according to W3C specs....

The request like the following is more annoying :

<soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding";
xsi:schemaLocation="http://foo/TruckTrace TruckTrace.xsd">
             <soap-env:Body>
                         <ns0:truckEnqui xmlns:ns0="http://foo/TruckTrace";>

<sClientAccountNo>F101012E</sClientAccountNo>

<dDepartureDate>2003-02-12T00:00:00</dDepartureDate>

<sSearchWithinFiveDays>Y</sSearchWithinFiveDays>
                                     <sRoute/>
                                     <sRegistrationNo/>
                         </ns0:truckEnqui>
             </soap-env:Body>
</soap-env:Envelope>

because then we got this error :

src-import.3.1: The namespace attribute 'http://foo/TruckTrace' of an
<import> element information item must be identical to the
targetNamespace attribute 'http://schemas.xmlsoap.org/soap/envelope/' of
the imported document.


And when changing the parser property to

Object value = "http://foo/TruckTrace "+ directory +"TruckTrace.xsd";

then I got

cvc-elt.1: Cannot find the declaration of element 'soap-env:Envelope'.

Am I wrong in the settings of the parser, Do I have to modify the
request, Do the Schema are OK? I am a bit lost. Does something exist
somewhere to help answering those questions a part W3C specs?

Thanx

Mederick


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to