users@jax-rpc.java.net

Re: wscompile - WSDL to Java interface mapping questions

From: Mark D. Hansen <khookguy_at_YAHOO.COM>
Date: Thu, 10 Jul 2003 09:23:00 -0400

I am using JAXRPC 1.1 EA. Why doesn't wscompile use JAXB to generate
the java class from the schema? Any plans for this?

Below is the schema for oms:SalesOrder

<?xml version="1.0"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Mark
Hansen (private) -->
<xs:schema targetNamespace="http://www.xyzcorp.com/oms"
xmlns:this="http://www.xyzcorp.com/oms"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="SalesOrder">
                <xs:annotation>
                        <xs:documentation>A Customer
Order</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                        <xs:sequence>
                                <xs:element name="SalesOrderKey">
                                        <xs:annotation>
                                                <xs:documentation>Unique
Sales Document Identifier</xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleType>
                                                <xs:restriction
base="xs:string">
                                                        <xs:maxLength
value="10"/>
                                                </xs:restriction>
                                        </xs:simpleType>
                                </xs:element>
                                <xs:element name="OrderHeader"
type="this:BUSOBJ_HEADER">
                                        <xs:annotation>
                                                <xs:documentation>Order
Header referencing customer, payment, sales organization
information</xs:documentation>
                                        </xs:annotation>
                                </xs:element>
                                <xs:element name="OrderItems">
                                        <xs:annotation>
                                                <xs:documentation>Items
in the Order</xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                                <xs:sequence>
                                                        <xs:element
name="item" type="this:BUSOBJ_ITEM" maxOccurs="unbounded"/>
                                                </xs:sequence>
                                        </xs:complexType>
                                </xs:element>
                                <xs:element name="OrderCcard"
minOccurs="0">
                                        <xs:annotation>
                                                <xs:documentation>Credit
Card Data</xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                                <xs:sequence>
                                                        <xs:element
name="item" type="this:BUSOBJ_CCARD" minOccurs="0"/>
                                                </xs:sequence>
                                        </xs:complexType>
                                </xs:element>
                                <xs:element name="OrderText"
minOccurs="0">
                                        <xs:annotation>
                                                <xs:documentation>Short
description of Order.</xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleType>
                                                <xs:restriction
base="xs:string">
                                                        <xs:maxLength
value="255"/>
                                                </xs:restriction>
                                        </xs:simpleType>
                                </xs:element>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
        <xs:complexType name="BUSOBJ_HEADER">
                <xs:annotation>
                        <xs:documentation>Sales and Distribution
Document Header</xs:documentation>
                </xs:annotation>
                <xs:sequence>
                        <xs:element name="SALES_ORG" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Sales
organization</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="4"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="PURCH_DATE">
                                <xs:annotation>
                                        <xs:documentation>Date that
customer placed the order</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:pattern
value="....-..-.."/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="CUST_NO">
                                <xs:annotation>
                                        <xs:documentation>Unique
customer identifier</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="10"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="PYMT_METH">
                                <xs:annotation>
                                        <xs:documentation>Payment
method</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:enumeration
value="PO"/>
                                                <xs:enumeration
value="CC"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="PURCH_ORD_NO" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Customer
purchase order number</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="35"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="WAR_DEL_DATE" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Guarantee
delivery date</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:pattern
value="....-..-.."/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="BUSOBJ_ITEM">
                <xs:annotation>
                        <xs:documentation>Sales and Distribution
Document Item</xs:documentation>
                </xs:annotation>
                <xs:sequence>
                        <xs:element name="ITM_NUMBER">
                                <xs:annotation>
                                        <xs:documentation>Unique
identifier for an item.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="6"/>
                                                <xs:pattern
value="\d+"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="STORAGE_LOC" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Storage
location</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="4"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="TARGET_QTY">
                                <xs:annotation>
                                        <xs:documentation>Target
quantity in sales units</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:decimal">
                                                <xs:totalDigits
value="13"/>
                                                <xs:fractionDigits
value="3"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="TARGET_UOM">
                                <xs:annotation>
                                        <xs:documentation>Target
quantity Unit of Measure</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="3"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="PRICE_PER_UOM">
                                <xs:annotation>
                                        <xs:documentation>Price per unit
of measure in US dollars</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:decimal">
                                                <xs:totalDigits
value="10"/>
                                                <xs:fractionDigits
value="2"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="SHORT_TEXT" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Short text
describing sales order item</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="40"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="BUSOBJ_CCARD">
                <xs:annotation>
                        <xs:documentation>Credit Card
Information</xs:documentation>
                </xs:annotation>
                <xs:sequence>
                        <xs:element name="CC_TYPE">
                                <xs:annotation>
                                        <xs:documentation>Payment cards:
Card type</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="4"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="CC_NUMBER">
                                <xs:annotation>
                                        <xs:documentation>Payment cards:
Card number</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="25"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="CC_EXPIRE_DATE">
                                <xs:annotation>
                                        <xs:documentation>Payment cards:
Expiration date</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:pattern
value="....-..-.."/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="CC_NAME">
                                <xs:annotation>
                                        <xs:documentation>Payment cards:
Name of cardholder</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:maxLength
value="40"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="BILLAMOUNT" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Value to be
billed on the date specified in billing plan</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:decimal">
                                                <xs:totalDigits
value="12"/>
                                                <xs:fractionDigits
value="2"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                        <xs:element name="CHARGE_DATE" minOccurs="0">
                                <xs:annotation>
                                        <xs:documentation>Date that card
is charged</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction
base="xs:string">
                                                <xs:pattern
value="....-..-.."/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                </xs:sequence>
        </xs:complexType>
</xs:schema>


-----Original Message-----
From: Public discussion on JAX-RPC
[mailto:JAXRPC-INTEREST_at_JAVA.SUN.COM]On Behalf Of Vivek Pandey
Sent: Thursday, July 10, 2003 2:38 AM
To: JAXRPC-INTEREST_at_JAVA.SUN.COM
Subject: Re: wscompile - WSDL to Java interface mapping questions


JAXRPC maps a XML schema type to the java class. If it can't map then it
maps it to SOAPELement.

It will be good to see the schema with oms:SalesOrder. Anyway, it looks
like oms:SalesOrder has some XML schema types for which jaxrpc doesnt
provide mapping and so it maps it to the SOAPElement.

BTY, with JAXRPC 1.1 EA, released as part of JWSDP1.2 the XML schema
support is enhanced from previous versions. If you're not using jaxrpc
1.1 then may like to give it a try.

-vivek.

Mark D. Hansen wrote:
> Why does wscompile create JAXB-like bindings for some parts in a WSDL
message but not others? For example:
>
> <wsdl:message name="order">
> <wsdl:part name="body" element="oms:SalesOrder"/>
> <wsdl:part name="messagetypeHeader"
element="xyz:typeofmessage"/>
> </wsdl:message>
>
> When I generate a server interface (Service Endpoint Interface) from
WSDL with the above message definition, the result is a java binding to
a generated class mapping to the schema xyz:typeofmessage. However, the
oms:SalesOrder schema gets bound to a generic SOAPElement class.
>
> Any ideas?
>
> Thanks,
>
> Mark