Problem loading SOAP 1.2 Schema for XML Validation

Mark Farnan <[email protected]> Tue, 18 Mar 2003 11:21:49 +1100
Newsgroups gmane.comp.windows.devel.soap.general
Message-ID <[email protected]>
I am attempting to Manually validate SOAP messages using the
"XmlValidatingReader"  and loading the Schema's for this, but it breaks.

When loading the SOAP 1.2 Envelope schema I get the following error.
-->  The prefix 'xml' in Xpath is unresolvable. An error occurred at
file:///C:/soap-envelope.xml (88, 6). "

The Schema file I am useing is the one found at
http://www.w3.org/2002/12/soap-envelope/


Code fragment below

try
{
        FileStream fsr = new FileStream("c:\\jake3.xml", FileMode.Open);
        XmlValidatingReader vr = new XmlValidatingReader(new XmlTextReader(fsr));
        vr.ValidationType = ValidationType.XDR;

vr.Schemas.Add("http://www.w3.org/2002/12/soap-envelope","C:\\soap-envelope.
xml");        <----- Error Here

vr.Schemas.Add("http://www.w3.org/2002/12/soap-encoding","C:\\soap-encoding.
xml");
        while (vr.Read()) ; // process stream and validate
}

catch (Exception e)
{
        Console.Write (e.Message);
}

Any help would be much appreciated as I have tried a number of things to get
this to work, and as far as I am aware, the xml:lang and the xml prefix are
loaded into the namespace by default.

Thanks

PS: I cross posted this to Soap and to C# as this is the first time on these
lists and not sure which one is best.

Mark Farnan
Senior Systems Engineer
Visean Online
+61-2-9957-2231
0422-304-256

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
You may be interested in Guerrilla Web Services .NET, 14 April 2003, in Torrance, CA
http://www.develop.com/courses/gwsdotnet

View archives and manage your subscription(s) at http://discuss.develop.com