Aha - good idea! Indeed - the WSDL 1.1 namespace is my default namespace, and yep that returns a Schemas collection of one as expected - thanks a lot.
However, I've just reread the docs and noticed that most unhelpfully ServiceDescription.Types.Schemas actually returns an XmlSchemas instance (that "is not intended to be used directly from your code" blah, blah..) rather than an XmlSchemaCollection. Apparently "In the default implementation of the Types class, this property returns an empty collection". I don't know if the different ServiceDescription.Read() overloads return internal subclasses of ServiceDescription, but I'm definitely getting a collection containing XmlSchema objects back. However, it doesn't sound like supported behaviour... As a result, I think I'm going to code up a lightweight ServiceDescription-like class myself that supports WSDL imports - for choice, I'd prefer access to a collection of schemas keyed by target namespace anyway rather than one schema with no target namespace. Thanks a lot for the suggestion though - Julian -----Original Message----- From: Jim Murphy [mailto:[EMAIL PROTECTED] Sent: 10 May 2004 14:49 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] ServiceDescription - importing schema into WSDL I haven't tried this in a while but... I assume the <import> tag is in the WSDL1.1 namespace by including xmlns="http://schemas.xmlsoap.org/wsdl/" in the Definitions node. wsdl:import is used for other WSDL documents. You should use an XML schema import instead. This is pretty easy to do by adjusting your WSDL: <types> <xs:schema> <xs:import namespace="thenamespace" schemaLocation="your.xsd"/> </xs:schema> </types> You can have as many <xs:import> elements as you like. I'd love to hear the results of this. Regards, Jim Murphy Mindreef, Inc. Julian Everett wrote: > Hi there, > > I've got an Xml schema that I want to use in a WSDL document. I can cut and > paste it into the WSDL, then load that doc into a ServiceDescription object > and access the schema via the ServiceDescription.Types.Schemas collection > and everything works fine. However for maintenance reasons instead of doing > this I just want to reference the schema, by using an "import" tag child > node of "types" that points to the schema on the filesystem: > > <types> > <import > namespace="http://schemas.teletext.co.uk/dtv/templatelist" > uri="templatelist.xsd"/> > <import namespace="http://schemas.teletext.co.uk/dtv/data" > uri="data.xsd"/> > </types> > > If I do this then ServiceDescription.Types.Schemas returns an empty > collection. Any ideas what I might be doing wrong? > > thanks a lot, > > Julian > > > IMPORTANT NOTICE > This communication contains information, which is confidential and may also > be privileged. It is for the exclusive use of the intended recipient(s). If > you are not the intended recipient(s) please note that any form of > distribution, copying or use of this communication or the information in it > is strictly prohibited and may be unlawful. If you have received this > communication in error please return it to the sender. The opinions > expressed within this communication are not necessarily those expressed by > Teletext Ltd. > > Teletext Ltd. > Building 10 > Chiswick Park > 566 Chiswick High Road > London W4 5TS > > Registered in England number 2694814 > > _____________________________________________________________________ > This message has been checked for all known viruses by Star Internet delivered > through the MessageLabs Virus Control Centre. For further information visit > http://www.star.net.uk/stats.asp > > =================================== > This list is hosted by DevelopMentor� http://www.develop.com > Some .NET courses you may be interested in: > > NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles > http://www.develop.com/courses/gaspdotnetls > > View archives and manage your subscription(s) at http://discuss.develop.com > > =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. For further information visit http://www.star.net.uk/stats.asp IMPORTANT NOTICE This communication contains information, which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender. The opinions expressed within this communication are not necessarily those expressed by Teletext Ltd. Teletext Ltd. Building 10 Chiswick Park 566 Chiswick High Road London W4 5TS Registered in England number 2694814 _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. For further information visit http://www.star.net.uk/stats.asp =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
