473,473 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem validating xml against schema

I have a web app that has been running happily for months, and on
Saturday it suddenly decided that it no longer wanted to validate my
XML. Here is my code and sample schema, and example XML :

public void ValidateAgainstSchema(object sender, ValidationEventArgs
args)
{
blnInvalidXML = true;
}

//in page load :

XmlTextReader tr = new XmlTextReader(new
StringReader(strReceivedXmlDoc));
XmlValidatingReader trv = new XmlValidatingReader(tr);

trv.ValidationType = ValidationType.Schema;

trv.ValidationEventHandler +=
new ValidationEventHandler(this.ValidateAgainstSchema) ;

while (trv.Read())
{
}

if (blnInvalidXML == false)
{
//do stuff
}

Schema :

<?xml version="1.0" encoding="iso-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="rsp-vcn">
<xs:complexType>
<xs:sequence>
<xs:element name="auth">
<xs:complexType>
<xs:sequence>
<xs:element name="cug" type="xs:long" />
<xs:element name="pasw" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="service">
<xs:complexType>
<xs:sequence>
<xs:element name="countrycode" type="xs:string" minOccurs="1" />
<xs:element name="number" type="xs:string" minOccurs="1" />
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="query" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="message_id" type="xs:byte" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>

XML :

<?xml version="1.0" encoding="iso-8859-1" ?>
<rsp-vcn message_id="0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://www.calluk.com/vcn/query.xsd">
<auth>
<cug>5790</cug>
<pasw>****</pasw>
</auth>
<service type="query">
<countrycode>1</countrycode>
<number>7813941801</number>
</service>
</rsp-vcn>

I can navigate to the schema in IE, and when I send through XML that the
schema should validate, it doesn't. I am stumped as this code has
worked fine for months.
Can anybody please shed any light on this?
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
1 815

Found the problem - the security certificate had expired.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Will | last post by:
I have been having problems validating an XForms document against the XForms schema located at http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd. I have reduced the XForm to its bare bones...
4
by: billcoumbe | last post by:
any recommendations? I'm looking for something that will just run from the unix command line to validate large (20-50Mb) XML files against an XML DTD. Ideally something that is actively...
1
by: Christian | last post by:
Hi, I load an Xml-file "customers.xml" into a DataSet (works fine) but then how do I validate it against a schema (e.g. customers.xsd) ? my customers.xml: <?xml version="1.0"...
2
by: Joris Janssens | last post by:
I'm trying to write a program for validating XHTML 1.1-documents against the XHTML 1.1 DTD (which is actually the same as validating an XML-file) but I always get a "(404) Not found" error. This...
3
by: Shailendra Batham | last post by:
hi guys I need your suggestions / opinion for doing this the right way. I have a XML and a Schema for the same What I want is when its validated against the schema, it should give custom...
0
by: RJN | last post by:
Hi My web service receives an object of type say MyObject. I want to serialize this object,and then validate the xml against the main xsd. When validation happens, it should also validate...
0
by: RJN | last post by:
Hi The main schema includes one more schema and the actual types are described in the included schema. eg., <xs:schema xmlns:t="http://myschemas/base" xmlns=""> <xs:import...
2
by: srujana | last post by:
Hi I am validating an xml document against schema . when i am passing the xml file location as an input to the parse method String XmlDocumentUrl="E:/books.xml"; parser.parse(XmlDocumentUrl);...
7
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
I wrote a method to validate and xml file against a schema. If the file does not conform to the schema, it throws an error. It works fine except for one curious thing. If I try to validate an...
4
by: agda.karlberg | last post by:
Hello, I need to remove the DTD reference from an xml document, the reason for this is that we want to validate against a schema instead (which we have locally). It takes up to a minute to fetch...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.