Hi,

> From: "Ian Macdonald" <ian / caliban.org>
> Sent: Monday, January 19, 2004 9:44 AM

> If I try to run my test script with the patched SOAP4R, I now get this:
> 
> [ianmacd / sagan]$ ./test3
> Restriction of basetype with simpleType definition is ignored for now.
> Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
[snip]
> Restriction of basetype with simpleType definition is ignored for now.
> Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
> 
> Is that the same thing you're talking about?

No.  Sorry for the unclear explanation.  Above messages warns that
wsdl4r just ignored "simpleType" definition in the WSDL.  Just
ignore these warning for now...

For example, "simpleType" is for restricting lexical space of the
user-defined type.

<?xml version="1.0"?>
<definitions name="rotr"
    targetNamespace="urn:www.example.com:rotr"
    xmlns:tns="urn:www.example.com:rotr"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="urn:www.example.com:rotr">
      <simpleType name="OrderItem">
        <restriction base="xsd:string">
          <enumeration value="fotr"/>
          <enumeration value="ttt"/>
          <enumeration value="rotk"/>
        </restriction>
      </simpleType>
      <complexType name="Order">
        <sequence>
          <element name="item" type="tns:OrderItem"/>
          <element name="quantity" type="xsd:int"/>
        </sequence>
      </complexType>
    </schema>
  </types>
</definitions>

With this WSDL, bin/wsdl2ruby.rb generates following class
definition.

# urn:www.example.com:rotr
class Order
  @@schema_type = "Order"
  @@schema_ns = "urn:www.example.com:rotr"

  def item
    @item
  end

  def item=(value)
    @item = value
  end

  def quantity
    @quantity
  end

  def quantity=(value)
    @quantity = value
  end

  def initialize(item = nil,
      quantity = nil)
    @item = item
    @quantity = quantity
  end
end

But item value should be restricted that it is one of "fotr",
"ttt", and "rotk" in the future.

OT: The 3rd movie is screened from Feb. 14 in Japan.

Regards,
// NaHi