1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
__ def/base.xsd _____________
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://robertdewilde.nl/"
  elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vacation="http://robertdewilde.nl/vacation/" xmlns:rdw="http://robertdewilde.nl/">

  <import schemaLocation="vacation.xsd" namespace="http://robertdewilde.nl/vacation/"/>
</schema>



__ def/vacation.xsd _____________
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://robertdewilde.nl/vacation/" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vacation="http://robertdewilde.nl/vacation/">

    <complexType name="bestemming">
      <sequence>
        <element name="naam" type="string"></element>
      </sequence>
      <attribute name="id" type="int"></attribute>
    </complexType>

    <complexType name="bestemmingen">
      <sequence>
        <element name="bestemming" type="vacation:bestemming" maxOccurs="unbounded" minOccurs="0"></element>
      </sequence>
    </complexType>

    <element name="bestemmingen" type="vacation:bestemmingen"></element>
    <element name="bestemming" type="vacation:bestemming"></element>
</schema>


__ In Servlet::init() _________________

/*
  ...
      */
    this.sRootPath = cConfig.getServletContext().getRealPath("/");

    try
    {  FileInputStream fisSchema = new FileInputStream(this.sRootPath + "def/base.xsd");
      commonj.sdo.helper.XSDHelper.INSTANCE.define(fisSchema, null); //this.sRootPath + "def/" // fisSchema.toString()
      fisSchema.close();
    } 
    catch (FileNotFoundException e1){  /* ... */  } 
    catch (IOException e)    {  /* ... */  }

/*
  ...
      */


__ In myDataObject::get() _________________  


/*
  ...
      */
                this.sNamespace = "http://robertdewilde.nl/vacation/";
                this.sNodeName  = "bestemmingen";

    this.doResource = HelperProvider.getDataFactory().create(
        TypeHelper.INSTANCE.getType
        (  this.sNamespace,
          this.sNodeName
        )      
    );
/* ########################### ^^ THIS GIVES BACK NULL ###*/
/* ############# ^^ Results in exception below:        ###
java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.rows.system.Endpoints.service(Endpoints.java:112)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Caused by: java.lang.IllegalArgumentException
  at org.apache.tuscany.sdo.util.DataObjectUtil.create(DataObjectUtil.java:2549)
  at org.apache.tuscany.sdo.helper.DataFactoryImpl.create(DataFactoryImpl.java:52)
  at org.rows.system.AbstractDataObject.initialize(AbstractDataObject.java:53)
*/
/*
  ...
      */