Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problem validating xml against schema

Reply
Thread Tools

problem validating xml against schema

 
 
Mike P
Guest
Posts: n/a
 
      12-06-2004
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 xmlnss="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"
xmlnssi="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!
 
Reply With Quote
 
 
 
 
Mike P
Guest
Posts: n/a
 
      12-06-2004

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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating xml file against xml schema using javascript First_step_to_xml XML 0 06-28-2006 02:09 PM
validating XML against schema using JDOM srujana XML 2 12-31-2005 11:20 AM
Validating parsed XML document against XML-schema TKok Java 1 12-08-2005 02:01 PM
Validating XML against a DTD that is not supplied in the XML Schema Ben Jessel Java 0 08-05-2004 11:45 AM
Validating XML file against an XSD schema in an ASP.NET page simon ames ASP .Net 1 04-11-2004 09:01 AM



Advertisments