Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » No targetnamespace set for local elements inside complextype
No targetnamespace set for local elements inside complextype [message #604126] Thu, 19 March 2009 07:33
Bhuvan  is currently offline Bhuvan
Messages: 36
Registered: July 2009

I have defined a complextype in an wsdl inside <types> section under
schema, as below :
------------------------------------------------------------ -----------
------------------------------------------------------------ -----------
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap=""
xmlns:xsd="" name="test"
<xsd:schema targetNamespace="">
<xsd:complexType name="ct1">
<xsd:element name="ele1" type="xsd:string"/>
------------------------------------------------------------ -----------

Now i am using below code snippet :
------------------------------------------------------------ -----------
String sourceLoc = "C:\\test.wsdl";

File file1 = new File(sourceLoc);
final ResourceSet resourceSet = new ResourceSetImpl();
final Resource res1 =
resourceSet.getResource(URI.createURI(file1.toURI().toString ()), true);
WSDLResourceImpl wsdlr = (WSDLResourceImpl)res1;
Definition definition = wsdlr.getDefinition();
Types types = definition.getETypes();
XSDSchema schema = (XSDSchema) types.getSchemas().get(0);
XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)
final XSDElementDeclaration element =
(XSDElementDeclaration)((XSDModelGroup)((XSDParticle)complex Type.getContent()).getContent()).


------------------------------------------------------------ -----------
So now when i get the targetNamespace for ele1 which is defined in complex
type "ct1" then it is returnd as "null", where as it should be

This case works fine when we have this schema defined in an XSD file and
process it ??

It seems there is something wrong in the "XSDSchema" which is returned by
wsdl "Definition".

Thanks and best regards,
Bhuvan Mehta
Previous Topic:Question Regarding Schemas in WSDL
Next Topic:No targetnamespace set for local elements inside complextype
Goto Forum:

Current Time: Fri Aug 01 18:29:26 EDT 2014

Powered by FUDForum. Page generated in 0.04497 seconds