You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Berin Loritsch <bl...@apache.org> on 2001/10/10 18:21:03 UTC

Namespace support (was: Re: AXIS chat log for 9 October, 2001)

Russell Butek wrote:
> 
> So we've agreed to:
> 1.  remove --package
> 2.  add some sort of command line argument for the namespace-to-package
> mappings
> 3.  look for a mapping properties file
> 4.  2 takes precedence over 3

Yep.  +1

> So now we have to decide
> 2.  What does the command line argument look like?  How about
>     --NStoPkg <ns0> <pkg0> -N <ns1> <pkg1> ... -N <nsN> <pkgN>

I'm thinking along the lines of what is easy to implement.  The CLI util that
we are already using supports 2 argurment parameters in the form of
<arg1>=<arg2>.  I suggest we use that.

I would be +1 to "--NStoPkg" being the long form and "-N" being the short form.

> 3.  What's the name of this file?  wsdl2java.mapping.properties?  Are the
> pairs in the file <namespace>=<package>?  What happens if the namespace
> string contains "=" or whitespace?  Does java.util.Properties handle it?
> Maybe the pairs should be <package>=<namespace>?

Yes, java.util.Properties does handle that.  Basically the information needs
to be escaped by a backslash ('\=').  If you generate the mapping from a
Properties file, you will see what I mean.  I believe whitespace requires
you to enclose the property name in quotes.  The Javadocs has all the information.

I believe it is easier for the user if the namespace is first.  Logically, we
are mapping the namespace to the package, not the other way around.  (not to
mention the problems with using the Properties object).

As to the name, it should probably match the WSDL file name with the "properties"
extension in lieu of the "wsdl" extension:

example:
---------------
test.wsdl
test.properties

> About your last point, Berin, I disagree with you.  I believe, via imports,
> you can have multiple WSDL definitions and, therefore, multiple namespaces
> for the WSDL things in the definitions.  Here's an example from section
> 2.1.2 of the WSDL spec.  The namespace for the service and the binding is
> "http://example.com/stockquote/service" and the namespace for the portType
> is "http://example.com/stockquote/definitions".  WSDL4J supports this.

My last point is regarding XInclude processing--meaning it should be done
before we process the WSDL document.  If the resulting WSDL is bad, the
author has given us an invalid document.  I am relatively new to WSDL in
detail, so if I say something rediculous let me know (as you are doing
now ;P).

In the example you presented, you are _not_ using XInclude semantics.  Therefore
my comments regarding XInclude don't apply here.  The confusion surrounded
comments (either in source or on the list) that alluded to us using XInclude
for the processing.  To use XInclude, the result would have to be altered
like this:

           <?xml version="1.0"?>
           <definitions name="StockQuote"

           targetNamespace="http://example.com/stockquote/definitions"
                     xmlns:tns="http://example.com/stockquote/definitions"
                     xmlns:xsd1="http://example.com/stockquote/schemas"
                     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                     xmlns:xi="http://www.w3.org/2001/XInclude"
                     xmlns="http://schemas.xmlsoap.org/wsdl/">

              <xi:include href="http://example.com/stockquote/stockquote.xsd"
                          xmlns="http://www.w3.org/2000/10/XMLSchema"/>

               <message name="GetLastTradePriceInput">
                   <part name="body" element="xsd1:TradePriceRequest"/>
               </message>

               <message name="GetLastTradePriceOutput">
                   <part name="body" element="xsd1:TradePrice"/>
               </message>

               <portType name="StockQuotePortType">
                   <operation name="GetLastTradePrice">
                      <input message="tns:GetLastTradePriceInput"/>
                      <output message="tns:GetLastTradePriceOutput"/>
                   </operation>
               </portType>
           </definitions>

The wsdl:import has different semantics around it--and in fact, I am surprised
that WSDL4J doesn't automagically handle it for us.  Since it is officially
part of the spec, I would think that this is something WSDL4J needs to do.  Otherwise,
the utility of it is reduced.