If you run WseWsdl2 against a definition that imports an external schema, like so:
<wsdl:definitions xmlns:foo="uri:foo" ...>
<wsdl:import namespace="uri:foo" location="Foo.xsd" />
<!-- then use foo:MyFooType somewhere in a message -->
Where Foo.xsd imports and leverages another schema like so:
<xsd:schema xmlns:bar="uri:bar" ...>
<xsd:import namespace="uri:bar" schemaLocation="Bar.xsd" />
<xsd:complexType name="MyFooType"><xsd:attribute name="myAttribute" type="bar:SomeSimpleType"/></xsd:complexType>
It doesn't seem to properly handle the importing of the Bar.xsd schema. I have all my XSDs in one directory for the test so it's not like trying to run off and discover them all over. Here's the error reported by WseWsdl2 when I try to import a scneario like this:
SchemaValidation Error! Details: Type 'uri:bar:SomeSimpleType' is not declared or not a simple type. An error occur
red at , (43, 4).
SchemaValidation Error! Details: Type 'uri:foo:MyFooType' is not declared.
An error occurred processing this WSDL. More information:
System.Exception: Schema Validation failed.
at ClientGen.Xsd.Compile(XmlSchemas userSchemas)
at ClientGen.Xsd.ImportSchemasAsClasses(String outputdir, ICodeGenerator code
Gen, String fileExtension, XmlSchemas schemas, String ns, String uri, IList elem
ents, StreamWriter writer)
at ClientGen.ClientGen.WriteSchemaClasses(ServiceDescription desc, StreamWrit
er writer)
at ClientGen.ClientGen.GenerateCode(ServiceDescription desc, String outputFil
e, XmlSchemas schemas)
at ClientGen.ClientGen.GenerateCode(String descriptionFile, String outputFile
, XmlSchemas schemas)
at ClientGen.Class1.Main(String[] arguments)
Can someone from MS confirm whether or not this is an unsupported scenario?
Thanks,
Drew
___________________________________
Drew Marsh
Chief Software Architect
Mimeo, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com/
Dan Rogers - 08 Dec 2004 01:15 GMT
Try putting the import in the schema that you need the second type exposed
in (e.g. use xs:import rather than wsdl.import) . As shown here, you are
telling WSDL ti import a schema, when wsdl:import is for importing other
WSDL information.
I hope this helps
Dan Rogers
Microsoft Corporation
--------------------
From: Drew Marsh <drub0y@hotmail.no.spamming.com>
Subject: WseWsdl2.exe doesn't seem to import third+ level schemas
Content-Type: text/plain; charset=iso-8859-1
X-Newsreader: JetBrains Omea Reader 341.19
Message-ID: <uKqDVRnzEHA.2624@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
Date: Fri, 19 Nov 2004 12:14:09 -0800
NNTP-Posting-Host: 65.223.252.240
Lines: 1
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:4890
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements
If you run WseWsdl2 against a definition that imports an external schema,
like so:
<wsdl:definitions xmlns:foo="uri:foo" ...>
<wsdl:import namespace="uri:foo" location="Foo.xsd" />
<!-- then use foo:MyFooType somewhere in a message -->
Where Foo.xsd imports and leverages another schema like so:
<xsd:schema xmlns:bar="uri:bar" ...>
<xsd:import namespace="uri:bar" schemaLocation="Bar.xsd" />
<xsd:complexType name="MyFooType"><xsd:attribute name="myAttribute"
type="bar:SomeSimpleType"/></xsd:complexType>
It doesn't seem to properly handle the importing of the Bar.xsd schema. I
have all my XSDs in one directory for the test so it's not like trying to
run off and discover them all over. Here's the error reported by WseWsdl2
when I try to import a scneario like this:
SchemaValidation Error! Details: Type 'uri:bar:SomeSimpleType' is not
declared or not a simple type. An error occur
red at , (43, 4).
SchemaValidation Error! Details: Type 'uri:foo:MyFooType' is not declared.
An error occurred processing this WSDL. More information:
System.Exception: Schema Validation failed.
at ClientGen.Xsd.Compile(XmlSchemas userSchemas)
at ClientGen.Xsd.ImportSchemasAsClasses(String outputdir, ICodeGenerator
code
Gen, String fileExtension, XmlSchemas schemas, String ns, String uri, IList
elem
ents, StreamWriter writer)
at ClientGen.ClientGen.WriteSchemaClasses(ServiceDescription desc,
StreamWrit
er writer)
at ClientGen.ClientGen.GenerateCode(ServiceDescription desc, String
outputFil
e, XmlSchemas schemas)
at ClientGen.ClientGen.GenerateCode(String descriptionFile, String
outputFile
, XmlSchemas schemas)
at ClientGen.Class1.Main(String[] arguments)
Can someone from MS confirm whether or not this is an unsupported scenario?
Thanks,
Drew
___________________________________
Drew Marsh
Chief Software Architect
Mimeo, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com/
Drew Marsh - 08 Dec 2004 03:50 GMT
> Try putting the import in the schema that you need the second type
> exposed in (e.g. use xs:import rather than wsdl.import) . As shown
> here, you are telling WSDL ti import a schema, when wsdl:import is for
> importing other WSDL information.
Ahh... of course you're right. I have no idea what I was thinking. *slaps
forehead*
Thanks Dan,
Dre