  | |  | Validation questions | Validation questions 2003-01-20 - By Kiran Bhumana
1) Can I pass the schema locations programmatically and not have them at all in the xml file ? As per what I gathered, I thought we could, but it does not recognize the schema. Only when I specify the schema location in the xml, will it try to parse against the file xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2002/07/business-proce ss/ http://schemas.xmlsoap.org/ws/2002/07/business-process.xsd"> parser.setProperty("http://apache.org/xml/properties/schema/external-sch emaLocation", "http://schemas.xmlsoap.org/ws/2002/07/business-process/ http://schemas.xmlsoap.org/ws/2002/07/business-process.xsd"); 2) Why does it not recognize the following schema definition? I can view it through explorer. (This same thing works fine with another xsd, per say, wsdl.xsd) [Warning]:6:139: schema_reference.4: Failed to read schema document 'http://schemas.x mlsoap.org/ws/2002/07/business-process.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:sc hema>. Thanks, Kiran. -----Original Message----- From: Kiran Bhumana Sent: Monday, January 20, 2003 3:49 PM To: xerces-j-user@(protected) Subject: RE: another Validation question So you are suggesting that I define my own xsd file and validate the instance against it ? -----Original Message----- From: Jeff Greif [mailto:jgreif@(protected)] Sent: Sunday, January 19, 2003 11:42 PM To: xerces-j-user@(protected) Subject: Re: another Validation question Since you are validating the document against the wsdl schema, it must conform to the WSDL schema. The root element, <definitions> must have element content of <documentation>?,<import>* <types>? ,<message>*,<portType>*,<binding>*, <service>* (and, in WSDL 1.2, <serviceType>*). No other element content is permitted. At least one content element other than documentation must be present. The various elements allowed as content may contain extension elements (outside the wsdl namespace) in certain parts of their content. <import> is used to access either datatypes or wsdl elements (those listed above) held in other files. In wsdl 1.2, no imported item may be in the targetNamespace of the wsdl definitions while wsdl 1.1 is looser. When <import> specifies a namespace, this means it is legal to refer to components from that namespace in the importing document. The schema processor must also be able to find the declarations of those references, and uses the schema locations for this purpose (or a location attribute specified in <import>). Jeff >>>> I have defined "slt" in the wsdl file. [Error]:20:40: cvc-complex-type.2.4.a: Invalid content starting with element 'slt:ser viceLinkType'. The content must match '(((("http://schemas.xmlsoap.org/wsdl/":documen tation){0-1}),((WC[##other:"http://schemas.xmlsoap.org/wsdl/"]){0-UNBOUN DED})),((("ht tp://
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft -com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1= "urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC -html40">
<head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 10"> <meta name=Originator content="Microsoft Word 10"> <link rel=File-List href="cid:filelist.xml@(protected)"> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="time"/> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="date"/> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:GrammarState>Clean</w:GrammarState> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @(protected) {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:553679495 -2147483648 8 0 66047 0;} @(protected) {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Courier New"; mso-fareast-font-family:"Times New Roman";} span.EmailStyle18 {mso-style-type:personal; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:windowtext;} span.EmailStyle19 {mso-style-type:personal; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.EmailStyle20 {mso-style-type:personal-reply; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @(protected) Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1" /> </o:shapelayout></xml><![endif]--> </head>
<body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>1) Can I pass the schema locations programmatically and not have them at all in the xml <span class=GramE>file ?</span><o:p></o:p></span>< /font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><span style='mso-spacerun:yes'> </span>As per what I gathered, I thought we could, but it does not recognize the schema.<o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Only when I specify the schema location in the xml, will it try to parse against the file<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'> </span>xsi:schemaLocation="http://schemas .xmlsoap.org/ws/2002/07/business-process/ http://schemas.xmlsoap.org/ws/2002/07/business-process.xsd"><o:p></o:p> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=GramE><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>parser.setProperty(</span ></font></span><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial; color:navy'>"http://apache.org/xml/properties/schema/external -schemaLocation", "http://schemas.xmlsoap.org/ws/2002/07/business-process/ http://schemas.xmlsoap.org/ws/2002/07/business-process.xsd");<o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>2) Why does it not recognize the following schema definition? I can view it through explorer. (This same thing works fine with another xsd, per say, wsdl.xsd)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>[Warning]:6:139: schema_reference.4: Failed to read schema document 'http<span class=GramE>:/</span>/schemas.x<o:p>< /o:p></span></font></p>
<p class=MsoNormal><span class=GramE><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>mlsoap.org/ws/2002/07 /business-process.xsd</span></font></span><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial; color:navy'>', because 1) could not find the document;<o:p></o:p></span></font> </p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>2) <span class=GramE>the</span> document could not be read; 3) the root element of the document is not <xsd:sc<o:p>< /o:p></span></font></p>
<p class=MsoNormal><span class=GramE><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>hema</span></font></span> <font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial; color:navy'>>.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Thanks,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Kiran.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br> <b><span style='font-weight:bold'>From:</span></b> Kiran Bhumana <br> <b><span style='font-weight:bold'>Sent:</span></b> </span></font><st1:date Month="1" Day="20" Year="2003"><font size=2 face=Tahoma><span style='font-size: 10.0pt;font-family:Tahoma'>Monday, January 20, 2003</span></font></st1:date> <font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> </span>< /font><st1:time Hour="15" Minute="49"><font size=2 face=Tahoma><span style='font-size:10.0pt; font-family:Tahoma'>3:49 PM</span></font></st1:time><font size=2 face=Tahoma> <span style='font-size:10.0pt;font-family:Tahoma'><br> <b><span style='font-weight:bold'>To:</span></b> xerces-j-user@(protected) <br> <b><span style='font-weight:bold'>Subject:</span></b> RE: another Validation question</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman" ><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;font-family:Arial;color:navy'>So you are suggesting that I define my own xsd file and validate the instance against it ?<o:p></o:p> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span>< /font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br> <b><span style='font-weight:bold'>From:</span></b> Jeff Greif [mailto:jgreif@(protected)] <br> <b><span style='font-weight:bold'>Sent:</span></b> </span></font><st1:date Month="1" Day="19" Year="2003"><font size=2 face=Tahoma><span style='font-size: 10.0pt;font-family:Tahoma'>Sunday, January 19, 2003</span></font></st1:date> <font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> </span>< /font><st1:time Hour="23" Minute="42"><font size=2 face=Tahoma><span style='font-size:10.0pt; font-family:Tahoma'>11:42 PM</span></font></st1:time><font size=2 face=Tahoma> <span style='font-size:10.0pt;font-family:Tahoma'><br> <b><span style='font-weight:bold'>To:</span></b> xerces-j-user@(protected) <br> <b><span style='font-weight:bold'>Subject:</span></b> Re: another Validation question</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman "><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Since you are validating the document against the wsdl schema, it must conform to the WSDL schema. The root element, <definitions> must have element content of</span></font><o :p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Verdana><span style='font-size:10.0pt;font-family:Verdana'><documentation>?,<import >* <types>? ,<message>*,<portType>*,<binding>*, <service>* (and, in WSDL 1.2, <serviceType>*). No other element content is permitted. At least one content element other than documentation must be present. The various elements allowed as content may contain extension elements (outside the wsdl namespace) in certain parts of their content.</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman "><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Verdana><span style='font-size:10.0pt;font-family:Verdana'><import> is used to access either datatypes or wsdl elements (those listed above) held in other files. In wsdl 1.2, no imported item may be in the targetNamespace of the wsdl definitions while wsdl 1.1 is looser. When <import> specifies a namespace, this means it is legal to refer to components from that namespace in the importing document. The schema processor must also be able to find the declarations of those references, and uses the schema locations for this purpose (or a location attribute specified in <import>).</span>< /font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman "><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Jeff</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman "><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman "><span style='font-size:12.0pt'> <font color=navy><span style='color:navy'>> >>></span></font><o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'>I have defined "slt" in the wsdl file.<o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'><o:p> </o:p> </span></font></p>
<p class=MsoPlainText style='margin-left:.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'>[Error]:</span>< /font><st1:time Hour="20" Minute="40"><font color=black><span style='color:black'>20:40</span>< /font></st1:time><font color=black><span style='color:black'>: cvc-complex-type.2.4.a: Invalid content starting with element 'slt:ser<o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'>viceLinkType'. The content must match '(((("http://schemas.xmlsoap.org/wsdl/" :documen<o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'>tation){0-1}),( (WC[##other:"http://schemas.xmlsoap.org/wsdl/"]){0-UNBOUNDED})),((( "ht<o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'>tp://</span>< /font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span>< /font></p>
</div>
</div>
</body>
</html>
|
|
|