Dang, better responses than I expected! Great!

First off, I have to confess that I *have* hacked stuff together using
the JWS mapping, but it was a very short lived experiment because..well,
it sucked. 

OK, so to get back on to the right path, what I am hearing consistently
is "Do not start with Java and generate WSDL from it." The reference
Bill sent went even further by saying to define the types using xsd
files. So I guess that is as good a place as any to start - in spite of
the fact that there is not a chance in heck I will be using Castor for
this! ;-)

Anyway, the service is intended to be implemented by companies that sell
books, movies and CDs. It would provide an interface for their customers
to use to look up products based on unique identifiers such as ISBN or
UPC code. Eventually, it will be expanded to allow more advanced
searches like Author and/or title fragment (eg., author = 'Stephen King'
and title like '%hospital%'). At that point, it will have to provide
methods that return arrays (per Anne's advice). For now, I will keep it
simple - single parameter searches that return 0-1 items. The data
returned would be a product that for simplicity will include these
properties: title (String), author (String), ISBN (String), UPC
(String), and listPrice (double).

So that translates into an xsd definition like this:

<xsd:element name="product">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="title" type="xsd:string"/>
            <xsd:element name="author" type="xsd:string"/>
            <xsd:element name="isbn" type="xsd:string"/>
            <xsd:element name="upc" type="xsd:string"/>
            <xsd:element name="listPrice" type="xsd:float"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

Next, I need to define the methods available. Again, keeping it simple:

<xsd:element name="getProductByUpc">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="upc" type="xsd:string" />
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>
<xsd:element name="getProductByUpcResponse">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element ref="product" />
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

Confession time again - I am using the stuff from the page Bill included
in his email, so if you see me doing something silly, please correct me.
:-)

If I am reading this correctly, I have defined what in Java will end up
being a bean, a method, and a return type for that method that will wrap
the bean.

Sooo, how am I doing so far? Tomorrow, unless there are issues with what
I have so far, I will dive into the WSDL. 

I am way too tired for that now. :-/

Larry

Reply via email to