Diskussion:Release 0.4
Aus DRV STRING
Version vom 27. März 2017, 09:00 Uhr von Holtermp (Diskussion | Beiträge) (First impressions of prorgamming with the API.)
To get a feel for the API I created a temporary WSDL with two operations "quote" and "book". From this I created a dummy java web application (WAR) using "wsimport" and played around with it a little.
Here are my first impressions and suggestions:
- Generation of code works fine with only one little problem:
- There are a few abstract types in the definitions, e.g. "StringCommonTravellerType". This prevented travellers to be created from the input xml request at runtime.
- So for the time being, I removed all four "abstract=true" statements in my local copy of the xsds. We should look into this.
- We should get rid of the "String"-Prefix of every type name.
- It just causes names to be longer without any additional information.
- It makes code completion features in IDEs difficult to use, if everything starts with "String...".
- Maybe we can get rid of redundant collection containers, i.e. if we have a <services/> element we do not need a <service/> element below that which in turn contains the concrete element <Accommodation/> . We should eliminate the generic <service/> element in between:
Currently we have to write:
<ns2:Services> <ns2:Service> <ns2:Accommodation> <ns2:Identifier>DUMMY_TEST_RESULT</ns2:Identifier> <ns2:EndDate xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns2:Stay xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ns2:Accommodation> </ns2:Service> </ns2:Services>
Which could be written more concise as:
<ns2:Services> <ns2:Accommodation> <ns2:Identifier>DUMMY_TEST_RESULT</ns2:Identifier> <ns2:EndDate xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns2:Stay xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ns2:Accommodation> </ns2:Services>