Whenever you REFER to a type you're defining, like ActionType in the
statement

<xsd:element name="Action" type="ActionType"/>

You must qualify it with the prefix for the namespace in which that type is
defined:

<xsd:element name="Action" type="intf:ActionType"/>

Russell Butek
[EMAIL PROTECTED]


"SMK.Reddy" <[EMAIL PROTECTED]> on 04/10/2002 01:24:57 AM

Please respond to [EMAIL PROTECTED]

To:    <[EMAIL PROTECTED]>
cc:
Subject:    Does WSDL2JAVA handles generating code for complex schema
       elements ??



Hi

I am using the following wsdl file. that describes the an order and the
response in a sync call. I tried best to generate java client and server
stubs using the wsdl2java tool. But no use I am getting many errors. I am
not sure, is WSDL cannot handle these complex objects in the wsdl? or some
thing wrong in my wsdl?

can any one suggest me on how to generate the Java server skeleton class
code and client stub codes for this wsdl file?

or is there any thing wrong with this wsdl file?

here is my wsdl file:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="OrderWebService"
targetNamespace="urn:xyz.com.schemas.som"
xmlns="http://schemas.xmlsoap.org/wsdl/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:intf="urn:xyz.com.schemas.som"
xmlns:tns1="http://xyz.com/schemas/order";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
 <wsdl:types>
 <xsd:schema targetNamespace="http://xyz.com/schemas/order";
xmlns="http://www.w3.org/2001/XMLSchema";>
 <xsd:element name="Order">
  <xsd:annotation>
   <xsd:documentation>Comment describing your root
element</xsd:documentation>
  </xsd:annotation>
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="TradeOrderID">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="8"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ClientID">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="8"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="Action" type="ActionType"/>
    <xsd:element name="Instrument" type="InstrumentType"/>
    <xsd:element name="ADPOrderID" type="ADPOrderID"/>
    <xsd:element name="HeldQueue" type="QueueType"/>
    <xsd:element name="DeleteFromHeldQueue" type="YesNoFlag"/>
    <xsd:element name="Activity" type="ActivityType"/>
    <xsd:element name="TempOrderID" type="ADPOrderID"/>
    <xsd:element name="OrderIDDate" type="xsd:date"/>
    <xsd:element name="AccountGroup">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="6"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="AccountNumber" type="AccountNumberType"/>
    <xsd:element name="Quantity" type="QuantityType"/>
    <xsd:element name="Symbol">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="16"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="TimeInForce" type="TIFType"/>
    <xsd:element name="TimeInForceDate" type="xsd:date"/>
    <xsd:element name="OrderQualifiers">
     <xsd:complexType>
      <xsd:attributeGroup ref="OrderQualifiersGrp"/>
     </xsd:complexType>
    </xsd:element>
    <xsd:element name="SellerOption" type="SellerOptionType"/>
    <xsd:element name="Price" type="PriceType"/>
    <xsd:element name="QuotedPrice" type="PriceType"/>
    <xsd:element name="HeldBy" type="SecurityHolder"/>
    <xsd:element name="TelephoneNumber">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="20"/>
       <xsd:whiteSpace value="preserve"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OptionExpirationMonth" type="MonthType"/>
    <xsd:element name="OptionStrikePrise">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="10"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OptionIndicator" type="OptionType"/>
    <xsd:element name="OptionPositionIndicator" type="OptionPositionType"/>
    <xsd:element name="ReInvestDividend" type="YesNoFlag"/>
    <xsd:element name="ReInvestCapitalGains" type="YesNoFlag"/>
    <xsd:element name="CancelQuantity" type="QuantityType"/>
    <xsd:element name="CancelPrice" type="PriceType"/>
    <xsd:element name="CancelTIF" type="TIFType"/>
    <xsd:element name="CancelTIFDate" type="xsd:date"/>
    <xsd:element name="CancelOrderQualifiers">
     <xsd:complexType>
      <xsd:attributeGroup ref="OrderQualifiersGrp"/>
     </xsd:complexType>
    </xsd:element>
    <xsd:element name="CancelSellersOption" type="SellerOptionType"/>
    <xsd:element name="RemainingQuantity" type="QuantityType"/>
    <xsd:element name="ProductCode" type="ProductCodeType"/>
    <xsd:element name="ForceApproval" type="ApprovalType"/>
    <xsd:element name="Commission" type="CommissionType"/>
    <xsd:element name="CommissionValue">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="15"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="SecurityRouteCode" type="SecurityRouteCode"/>
    <xsd:element name="Class">
     <xsd:simpleType>
      <xsd:restriction base="xsd:string">
       <xsd:maxLength value="15"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="SettlingCurrency" type="CurrencyType"/>
    <xsd:element name="TrailerCode1" type="TrailerCodeFormat"/>
    <xsd:element name="TrailerCode2" type="TrailerCodeFormat"/>
    <xsd:element name="TrailerCode3" type="TrailerCodeFormat"/>
    <xsd:element name="CommentTrailer">
     <xsd:simpleType>
      <xsd:restriction base="xsd:string">
       <xsd:maxLength value="19"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="PSTrailerCode1" type="TrailerCodeFormat"/>
    <xsd:element name="PSTrailerCode2" type="TrailerCodeFormat"/>
    <xsd:element name="PSTrailerCode3" type="TrailerCodeFormat"/>
    <xsd:element name="PSTrailer">
     <xsd:simpleType>
      <xsd:restriction base="xsd:string">
       <xsd:maxLength value="11"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="RegRep">
     <xsd:simpleType>
      <xsd:restriction base="xsd:string">
       <xsd:length value="3"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="SolicitedCode" type="YesNoFlag"/>
   </xsd:sequence>
   <xsd:attribute name="NotHeld" type="xsd:string"/>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="OrderStatus">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="MessageType">
     <xsd:simpleType>
      <xsd:restriction base="xsd:string">
       <xsd:maxLength value="1"/>
       <xsd:enumeration value="V"/>
       <xsd:enumeration value="M"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:choice>
     <xsd:element ref="Sent"/>
     <xsd:element ref="ValidationError"/>
    </xsd:choice>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="Sent">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="ADPOrderID">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="8"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ADPOrderID_Date" type="xsd:date"/>
    <xsd:element name="LID">
     <xsd:simpleType>
      <xsd:restriction base="xsd:normalizedString">
       <xsd:maxLength value="4"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="NextDayFlag">
     <xsd:simpleType>
      <xsd:restriction base="xsd:boolean">
       <xsd:pattern value="(true|false)"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ApprovalFlag">
     <xsd:simpleType>
      <xsd:restriction base="xsd:boolean">
       <xsd:pattern value="(true|false)"/>
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:element>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="ValidationError">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="Error" maxOccurs="6">
     <xsd:complexType>
      <xsd:simpleContent>
       <xsd:extension base="xsd:string">
        <xsd:attribute name="Code" use="required">
         <xsd:simpleType>
          <xsd:restriction base="xsd:string">
           <xsd:length value="2"/>
          </xsd:restriction>
         </xsd:simpleType>
        </xsd:attribute>
       </xsd:extension>
      </xsd:simpleContent>
     </xsd:complexType>
    </xsd:element>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:simpleType name="YesNoFlag">
  <xsd:restriction base="xsd:boolean">
   <xsd:pattern value="(true|false)"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="ActionType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="Buy"/>
   <xsd:enumeration value="Sell"/>
   <xsd:enumeration value="SellShort"/>
   <xsd:enumeration value="SellExempt"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="InstrumentType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="Equity"/>
   <xsd:enumeration value="Bond"/>
   <xsd:enumeration value="MutualFund"/>
   <xsd:enumeration value="Option"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="ADPOrderID">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:maxLength value="8"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="QueueType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="Approval"/>
   <xsd:enumeration value="NextDay"/>
   <xsd:enumeration value="Unknown"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="ActivityType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="New"/>
   <xsd:enumeration value="Cancel"/>
   <xsd:enumeration value="Replace"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="AccountNumberType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:length value="10"/>
   <xsd:whiteSpace value="collapse"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="QuantityType">
  <xsd:restriction base="xsd:positiveInteger">
   <xsd:totalDigits value="18"/>
   <xsd:whiteSpace value="collapse"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="TIFType">
  <xsd:restriction base="xsd:token">
   <xsd:enumeration value="GoodTillCancelled"/>
   <xsd:enumeration value="GoodTillEOD"/>
   <xsd:enumeration value="GoodTillET"/>
   <xsd:enumeration value="GoodThroughWeek"/>
   <xsd:enumeration value="GoodThroughMonth"/>
   <xsd:enumeration value="GoodThroughDay"/>
   <xsd:enumeration value="ImmedieteOrCancel"/>
   <xsd:enumeration value="OnOpening"/>
   <xsd:enumeration value="FillOrKill"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="SellerOptionType">
  <xsd:restriction base="xsd:int">
   <xsd:totalDigits value="2"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="PriceType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:maxLength value="25"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="SecurityHolder">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="Customer"/>
   <xsd:enumeration value="Bank"/>
   <xsd:enumeration value="House"/>
   <xsd:enumeration value="UnKnown"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="MonthType">
  <xsd:restriction base="xsd:token">
   <xsd:length value="3"/>
   <xsd:enumeration value="JAN"/>
   <xsd:enumeration value="FEB"/>
   <xsd:enumeration value="MAR"/>
   <xsd:enumeration value="APR"/>
   <xsd:enumeration value="MAY"/>
   <xsd:enumeration value="JUN"/>
   <xsd:enumeration value="JUL"/>
   <xsd:enumeration value="AUG"/>
   <xsd:enumeration value="SEP"/>
   <xsd:enumeration value="OCT"/>
   <xsd:enumeration value="NOV"/>
   <xsd:enumeration value="DEC"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="OptionType">
  <xsd:restriction base="xsd:token">
   <xsd:enumeration value="Call"/>
   <xsd:enumeration value="Put"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="OptionPositionType">
  <xsd:restriction base="xsd:token">
   <xsd:enumeration value="Open"/>
   <xsd:enumeration value="Close"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="ProductCodeType">
  <xsd:restriction base="xsd:token">
   <xsd:maxLength value="3"/>
   <xsd:enumeration value="API"/>
   <xsd:enumeration value="REA"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="ApprovalType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="Default"/>
   <xsd:enumeration value="AlwaysApprove"/>
   <xsd:enumeration value="ShipToSupervisor"/>
   <xsd:enumeration value="ShipToDNSWithErrors"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="CommissionType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:enumeration value="Total"/>
   <xsd:enumeration value="PerShare"/>
   <xsd:enumeration value="Percentage"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="SecurityRouteCode">
  <xsd:restriction base="xsd:token">
   <xsd:maxLength value="3"/>
   <xsd:enumeration value="CDN"/>
   <xsd:enumeration value="AR"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="CurrencyType">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:length value="2"/>
   <xsd:pattern value="(C|U)$"/>
   <xsd:enumeration value="C$"/>
   <xsd:enumeration value="U$"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="TrailerCodeFormat">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:maxLength value="3"/>
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:attributeGroup name="OrderQualifiersGrp">
  <xsd:attribute name="NotHeld" type="YesNoFlag" default="false"/>
  <xsd:attribute name="DoNotReduce" type="YesNoFlag" default="false"/>
  <xsd:attribute name="AllOrNone" type="YesNoFlag" default="false"/>
  <xsd:attribute name="ProTrader" type="YesNoFlag" default="false"/>
  <xsd:attribute name="NoProfitOrLoss" type="YesNoFlag" default="false"/>
  <xsd:attribute name="SettleInCash" type="YesNoFlag" default="false"/>
  <xsd:attribute name="NextDaySettlement" type="YesNoFlag" default
  ="false"/>
  <xsd:attribute name="SettleInDays" type="YesNoFlag" default="false"/>
  <xsd:attribute name="ExecuteTradeOnTick" type="YesNoFlag"
default="false"/>
  <xsd:attribute name="PrimeryExchangeCode" type="YesNoFlag"
default="false"/>
  <xsd:attribute name="OneSideTrade" type="YesNoFlag" default="false"/>
  <xsd:attribute name="TwoSideTrade" type="YesNoFlag" default="false"/>
 </xsd:attributeGroup>
</xsd:schema>

</wsdl:types>

  <!-- wsdl:message elements describe potential transactions -->

  <!-- request SOMOrderInput is of type SOMOrder -->
  <wsdl:message name="SOMOrderInput">
    <wsdl:part name="body" element="tns1:Order"/>
  </wsdl:message>

  <!-- response GSOMOrderStatusOutput is of type OrderStatus -->
  <wsdl:message name="SOMOrderStatusOutput">
    <wsdl:part name="body" element="tns1:OrderStatus"/>
  </wsdl:message>

  <!-- wsdl:portType describes messages in an operation -->
  <wsdl:portType name="SOMPortType">
    <!-- the value of wsdl:operation eludes me -->
    <wsdl:operation name="placeOrder">
      <wsdl:input message="intf:SOMOrderInput"/>
      <wsdl:output message="intf:SOMOrderStatusOutput"/>
    </wsdl:operation>
  </wsdl:portType>

  <!-- wsdl:binding states a serialization protocol for this service -->
  <wsdl:binding name="SOMSoapBinding" type="intf:SOMPortType">

    <!-- leverage off soap:binding rpc style  -->
    <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>

    <!-- semi-opaque container of network transport details classed by
soap:binding above @@@ -->
    <wsdl:operation name="placeOrder">

      <!-- again bind to SOAP? @@@ soapAction needs to be defined for the
SOM  -->
      <soap:operation soapAction="http://com.xyz/somservice/placeOrder"/>

      <!-- furthur specify that the messages in the wsdl:operation
"placeOrder" use SOAP? @@@ -->
      <wsdl:input>
        <soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
        namespace="urn:xyz.com.schemas.som"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
        namespace="urn:xyz.com.schemas.som"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <!-- wsdl:service names a new service "SOM Order placing service" -->
  <wsdl:service name="SOMService">
    <wsdl:documentation>SOM Order Placeing service to place
orders</wsdl:documentation>

    <!-- connect it to the binding "EndorsementSearchSoapBinding" above -->
    <wsdl:port name="SOMPort" binding="intf:SOMSoapBinding">

      <!-- give the binding an network address needs conformation -->
      <soap:address location="http://com.xyz/somservice"/>
    </wsdl:port>
  </wsdl:service>
 </wsdl:definitions>

here are the command lines options i tried.

org.apache.axis.wsdl.WSDL2Java -v -a -T1.2 -D somtest.wsdl



Reply via email to